the declaration of global variables
Posted: Tue Apr 13, 2004 1:42 am
does anyone knows if I set global register to off in the php.ini will declaring a variable as global in a function still take effect?
<?php
function get($var){
return $var;
}
function set($var, $val){
global $var;
$var = $val;
}
?>
If i use the function in another file say try.php
set($donkey, 5);
echo ($donkey); (does not seems to print out... cos no value
)
any kind soul out there pls help..
<?php
function get($var){
return $var;
}
function set($var, $val){
global $var;
$var = $val;
}
?>
If i use the function in another file say try.php
set($donkey, 5);
echo ($donkey); (does not seems to print out... cos no value
any kind soul out there pls help..