My suggestion would be using file(), what this function does is return the entire file with every line an element in an array. The easiest way to grab an entire file into one variable is to use implode() along with file(), eg;
$filedata = implode("\n", file("myfile.txt"));
Simple
HTH
Matt