...

View Full Version : Why dont i get an echo of 10 for this code



kevinkhan
09-14-2011, 10:00 PM
Why dont i get an echo of 10 for this code


function test() {
$test = 10;

//echo "inside function echo " . $test;
global $test;
}

test();
echo $test;
exit;

>ssp-cdr<
09-14-2011, 11:28 PM
Put the global at the beginning of the function.

Fou-Lu
09-14-2011, 11:29 PM
See my explanation of the problem in your other thread.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum