Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
This is really basic PHP. Can someone tell me why this does not work and what I need to do to make it work.
<?php $test_var=12; proc_scrn($test_var); proc_scrn($local_pid) { echo "tp12",$local_pid ; } ?>
function
echo "tp12".$local_pid;
echo
Well, you haven't actually created a function there. This would work:
<?php $test_var=12; proc_scrn($test_var); function proc_scrn($local_pid='') { echo "tp12: ".$local_pid; } ?>
Add a comment
function proc_scrn($local_pid) { // something }
PHP- User-defined functions
Pretty simple
<?php $var=1; function proc_scrn($var1){ echo "tp12: ".$var1; } proc_scrn($var); ?>
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
functionbefore proc_scrn. And I am not sure if the echo-part will work. Try changing it toecho "tp12".$local_pid;echostatement is fine and is actually faster than concatenation