Reading from a file
<p>I have file with contents:</p>

<pre><code>Tom TOM is a good student with excellent marks. This profile can be viewed online ar www.x.xom/tom/marks. He is one of the oustanding student
Tom1 TOM is a good student with excellent marks. This profile can be viewed online ar www.x.xom/tom/marks. He is one of the oustanding student
Tom2 TOM is a good student with excellent marks. This profile can be viewed online ar www.x.xom/tom/marks. He is one of the oustanding student
</code></pre>

<p>I have many lines like this.
Each line is having a name followed by a string untill end of the line.</p>

<p>I want to have a php script that will read first words keeps in a temp variable.
similarly I want all the text upto the end of the line to be going to the second variable.</p>

<p>I have used these</p>

<pre><code>$myFile = "profiles.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, 5);
fclose($fh);
echo $theData;
</code></pre>

<p>but the issue with that is I am able to read the first 5 characters. I want to read first time only one word. second one is all string to be going to a variable.</p>
