You are here: Re: Also... Re: PHP includes question « PHP Programming Language « IT news, forums, messages
Re: Also... Re: PHP includes question

Posted by Jerry Stuckle on 02/03/07 04:20

Sanders Kaufman wrote:
> Nu wrote:
>> "Sanders Kaufman" <bucky@kaufman.net> wrote in message
>> news:cwhwh.2295$4H1.1365@newssvr17.news.prodigy.net...
>>> Nu wrote:
>>>
>>>> I have seen code like this:
>>>> if ( file_exists( "$IP/languages/classes/$class.deps.php" ) ) {
>>>> include_once("$IP/languages/classes/$class.deps.php");
>>>> }
>>>> It appears not to load the file unless an if statement passes.
>>> Well, I could be wrong - it would be as easy as RTFM to verify. :)
>>
>> I can't find anything in the manual on this.
>
> Check the page that discusses "require_once" and "include_once".
> It's all there.

Yep.

"The include_once() statement includes and evaluates the specified file
during the execution of the script."

It's an execution time statement, not a compile time statement.
Therefore it will only include the file if this statement is executed.

For instance:

if (false)
include_once('myfile.php');

will never include the file.

require_once() has a similar statement.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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