I have file with contents:
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
I have many lines like this.
Each line is having a name followed by a string untill end of the line.
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.
I have used these
$myFile = "profiles.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, 5);
fclose($fh);
echo $theData;
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.
Something like this?