Re: [PHP3] file to variable From: Brian T. Allen (brian <email protected>)
Date: 02/29/00

I have tried to find this too, it is a feature of PERL that I love. The
closest I have come is:

$ARRAY = file('/home/user/file.txt');
for ($u=0; $u<count($ARRAY); $u++) {
echo "$ARRAY[$u]<br>\n";
}

However, you cannot do a search and replace on the entire file, etc. I
would much rather have it in a string, at least for some applications.

I want a PHP replacement for this PERL:

$STRING = `/bin/cat /home/user/file.txt`;

Please let me know if you find anything.

Thanks,
Brian Allen
brian <email protected>

> Can anyone send me a snippet of code showing the syntax/commands to take a
text file and pass it into a string variable?
>
> Thanks in advance.
>
> Tobe Johnson
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe <email protected>
> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected>
> To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin <email protected>

-- 
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest, e-mail: php3-digest-subscribe <email protected>
To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-admin <email protected>