| 
	
 | 
 Posted by Darko on 05/28/07 16:14 
On May 28, 6:03 pm, Michael <MichaelDMcDonn...@yahoo.com> wrote: 
> Since the include function is called from within a PHP script, why 
> does the included file have to identify itself as a PHP again by 
> enclosing its code in <?php> ... <?> 
> 
> One would assume that the PHP interpreter works like any other, that 
> is, it first expands all the include files, and then parses the 
> resulting text. Can anyone help with an explanation? 
> 
> Thanks, 
> M. McDonnell 
 
It's not supposed to be bracketed by <?php> and <?>, but by <?php and ? 
>. That's not necessary, though. You have to put those symbols into 
your require-d file if you want it to be understood like php code, but 
if you don't, it will be understood as raw output. Just like any other 
php file: 
<?php 
    if ( $x ) { 
?> 
some output here 
some output here 
some output here 
<?php 
    } else { 
?> 
some other output here 
some other output here 
some other output here 
<?php
 
  
Navigation:
[Reply to this message] 
 |