You are here: Re: Why does include file text need to be bracketed by <?php> ... <?> « PHP Programming Language « IT news, forums, messages
Re: Why does include file text need to be bracketed by <?php> ... <?>

Posted by Geoff Berrow on 05/29/07 00:39

Message-ID: <1180370371.580860.72150@x35g2000prf.googlegroups.com> from
Michael contained the following:

>I guess I'm still missing the point. Once the browser interpreter sees
>the <?php, it assumes that all text to follow is php code until the
>terminating token ?> is seen. Now if the include function is called
>within the <?php ... ?>, the interpreter still assumes that any text
>it sees is PHP. So again, I don't understand why the include text
>needs to bracket its code in <?php ...?>. What am I missing here?

Ummm...reading the manual?

http://uk.php.net/include/

"When a file is included, parsing drops out of PHP mode and into HTML
mode at the beginning of the target file, and resumes again at the end.
For this reason, any code inside the target file which should be
executed as PHP code must be enclosed within valid PHP start and end
tags."

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация