Reading a File into a String in PHP


Use file_get_contents() to read the entire file into a string.

Source Code

$fileContent = file_get_contents("example.txt");
echo $fileContent;
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments