[thelist] PHP include

Jack Timmons codeacula at codeacula.com
Fri Aug 6 12:54:31 CDT 2010


On Fri, Aug 6, 2010 at 12:46 PM, DAVOUD TOHIDY <dtohidy at hotmail.com> wrote:
>
> Hi There,
>
> I have got a quick and stupid question :)
>
> Here it is the scenario:
>
> I have a file called file.php
> I have another file called otherfile.php
>
> Content of otherfile.php:
>
> if (something) {
> do some stuff
> }
>
> Content of file.php:
>
> <?php
> include(otherfile.php);
> else if (other thing) {
> do other things
> }
> ?>
>
> Shouldn't the above senario work? but I do get a parse error for the ELSE if.
>
> Thanks for your input
>
> davoud

No, because when you include a PHP file, you simply execute it, not
copy the file contents.

-- 
Jack Timmons
@_Codeacula


More information about the thelist mailing list