how to pass variables between 2 php pages when the latter called with require() -
i php newbie, , have question:
say have:
a.php:
$a = 'foo' ; $b = 'baz' ; require ('b.php') ;
how pass variables $a , $b b.php ? how use these variables in b.php ?
thanks lot !!
just make sure call require() after setting variables, , should available in b.php.
a.php:
$a = 'foo'; $b = 'baz'; require('b.php');
b.php:
echo 'a: '. $a; echo 'b: '. $b;
Comments
Post a Comment