PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have pure php in my include file. Do I have to have / is it allowed to have. <?php and ?> tags in my include file? Include code looks like this:
<?php
require_once 'all_fun.php';
?>
And all_fun.php like this
<?php
all_fun_contentshere
?>
If I understand correctly PHP outputs everything from my include file to the place where require_once is called... So the code is effectively like this?
<?php
<?php
all_fun_contentshere
?>
?>
Someone said to me that include files must have those tags too, but i think that they are futile, perhaps even a mistake? What PHP does when it encounters nested php tags?
Included files have to have the <? ?> tags or ASP tags (if enabled) in order to make php parse the files... otherwise it'll just include the file as text. include() and require() don't only include php files... there would be no point in parsing non-PHP files.