RE: [PHP] include opens source, but it shouldn't
| From: | Non-HP-Boise,ex1) | Date: | Thu, 15 Aug 2002 16:46:31 +0000 |
| Subject: | RE: [PHP] include opens source, but it shouldn't | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-112806@lists.php.net to get a copy of this message | ||
It will probably behave the same way include does, which is correct
behavior.
$file=include(whatever) is telling php to store the result from include in
the $file variable, not storing a command in it.
You could do $file='include()', and then you would wind up with a variable
with whatever text you assigned to it.
This is covered in the manual,
Jason
-----Original Message-----
From: Sascha Braun [mailto:saschabraun@gmx.de]
Sent: Thursday, August 15, 2002 10:31 AM
To: PHP Mailingliste; Jay Blanchard
Subject: Re: [PHP] include opens source, but it shouldn't
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
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php