What is the easiest way to search through a file for a pattern? I want a user to upload a text file and then the PHP script will analyze it and search for all the email addresses and output them seperated by a comma.
I tried using strstr() but it only works for the first email and does not continue searching for more emails.