Re: PHP codes and variables
| From: | Richard Lynch | Date: | Tue, 16 Jul 2002 03:35:09 +0000 |
| Subject: | Re: PHP codes and variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-107785@lists.php.net to get a copy of this message | ||
>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.
<?php
$data = file('/full/path/to/filename') or die("Could not open file.");
$data = implode('', $data);
?>
--
Like Music? http://l-i-e.com/artists.htm