+ 1
in this program why variable c access outside of the function..if i put echo $c within function then give some error.
<?php $x=50; $y=20; function sum() { $GLOBALS['c']=$GLOBALS['x']+$GLOBALS['y']; } sum(); echo $c; ?>
3 Réponses
0
Your code was good.in your code their was a return so the output is returning to the function.if you want to print with in function than than can be possible.
But in my code if I want to print global variable c with in function than give some error.