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]
|