Re: include opens source, but it shouldn't
| From: | Sascha Braun | Date: | Thu, 15 Aug 2002 16:30:46 +0000 |
| Subject: | Re: include opens source, but it shouldn't | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-112801@lists.php.net to get a copy of this message | ||
Can't you use a fopen('$file','r+'); or some like this instead?
Otherwise, I don't use vars to store includes in.
I always use constructs like this:
include('/path-to-file/file-name.inc.php');
But what happens when you put a file via fopen() driektive into an array? -
Will it be parsed later on?
Schura
----- Original Message -----
From: "Jay Blanchard" <jay.blanchard@niicommunications.com>
To: "'Harry.de'" <harald.mohring@gmx.de>;
<php-general@lists.php.net>
Sent: Thursday, August 15, 2002 6:25 PM
Subject: RE: [PHP] include opens source, but it shouldn't
> [snip]
> why does include always opens my included file
> although it is defined as a variable
>
> Example:
>
> $file=include(/myfile/myfile.txt/);
>
> shouldn't it only be opend by typing
>
> echo $file;
> [/snip]
>
> The include() opens the file to place it in the variable, in other words
> include means READ INTO. Therfore
> $file=READ INTO THIS FILE(/myfile/myfile.txt/);
>
> HTH!
>
> Jay
>
> I'm really easy to get along with, once you people learn to worship me
>
> ***********************************************************
> * Texas PHP Developers Conf Spring 2003 *
> * T Bar M Resort & Conference Center *
> * New Braunfels, Texas *
> * San Antonio Area PHP Developers Group *
> * Interested? Contact jay.blanchard@niicommunications.com *
> ***********************************************************
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>