How can I capture a txt file's content to a variable
Posted: Sun Oct 06, 2002 6:32 am
How can I capture a txt file's content to a variable??? For ex: i have a $message variable how can I send the inside of message.txt to this variable???
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$fileArray = file("/path/to/file.txt");
foreach($fileArray as $eachLine) {
echo $eachLine."<br>\n";
}
?>