So I have a text file that has a persons name, email message and email address on each line. I need a way to output only the name and the email message, while just ignoring the the email address on the end.
My text file looks like this.
Joe Hello how are you? joe@yahoo.com
Jim Whats up? jim@yahoo.com
Megan How is everyone doing? megan@yahoo.com
I was using a foreach loop to print out each line, but it of course keeps the email address, so how would I do this but not add the email address?
$messages = file('messages.txt');
foreach($messages as $message)
{
echo $message;
}