When you insert a header ( require ('whatever.php') )
does php parse that code, and then insert the results in the page it was called for, or does it insert the plain php code and then parse the whole page? Because if it just inserted the plain php, and then parsed the whole thing i was going to do this:
in index.php-
$text1 = "Hello All"
$text2 = "Yo Danny Boy!"
require ('header.php')
blah blah blah~~~~~~
in header.php-
echo "$text1";
echo "$text2";
blah blah blah~~~ (i hope my code is correct, im new to php)
Would that work? Or would i have to use global variables if it parses the header then inserts it?
Also, could you explain the syntax for global variables?
does php parse that code, and then insert the results in the page it was called for, or does it insert the plain php code and then parse the whole page? Because if it just inserted the plain php, and then parsed the whole thing i was going to do this:
in index.php-
$text1 = "Hello All"
$text2 = "Yo Danny Boy!"
require ('header.php')
blah blah blah~~~~~~
in header.php-
echo "$text1";
echo "$text2";
blah blah blah~~~ (i hope my code is correct, im new to php)
Would that work? Or would i have to use global variables if it parses the header then inserts it?
Also, could you explain the syntax for global variables?