Re: PHP codes and variables
| From: | Kevin Stone | Date: | Fri, 12 Jul 2002 18:35:40 +0000 |
| Subject: | Re: PHP codes and variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-107412@lists.php.net to get a copy of this message | ||
Or use implode instead of join makes skips the step of extracting the
index..
$file = implode ('', file ("afile.html"));
If you'll be sending more output than just one file then another favorite
method is this..
ob_start();
readfile("file1.txt");
readfile("file2.html");
$output = ob_get_contents();
ob_end_clean();
-Kevin
----- Original Message -----
From: "Miguel Cruz" <mnc@stoic.net>
To: "J. Alden Gillespy" <doggabow@jackloren.com>
Cc: "Groups - PHP-General" <php-general@lists.php.net>
Sent: Friday, July 12, 2002 12:17 PM
Subject: Re: [PHP] PHP codes and variables
> On Fri, 12 Jul 2002, J. Alden Gillespy wrote:
> > Anyone know how to do have a variable equal the contents of a file? I
tried
> > the include function, but it just prints the file out on the screen
rather
> > than including the contents in the variable itself. I need help with
this
> > ASAP. Thanks.
>
> $variable = join('', file('path/to/file'));
>
> miguel
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>