I am a PHP newbie, and I have this question:
say I have:
a.php:
$a = 'foo' ;
$b = 'baz' ;
require ('b.php') ;
How do I pass variables $a and $b to b.php ?
How do I use these variables in b.php ?
thanks a lot !!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just make sure you call require() after setting the variables, and they should be available in b.php.
a.php:
b.php: