copy file content to string variable
Posted: Thu Dec 24, 2009 8:18 am
Is there any function in php library that will copy the contents of a text file into string ??
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
//set file name
$file = 'myfile.html';
//echo contents of file
echo(stripslashes(file_get_contents($file)));
//echo contents of file exactly (will display special chars in browser)
echo(htmlentities(stripslashes(file_get_contents($file))));