I want to load a file as a string in PHP and collect all the email IDs in it as an array. How do I load the text file as a string?
$string = **
WITHIN TEXT FILE "email@example.com MIME-Version: bla bla bla firstname.lastname@example.org";
$matches = array();
$pattern = '/[A-Za-z0-9_-]+@[A-Za-z0-9_-]+\.([A-Za-z0-9_-][A-Za-z0-9_]+)/'
preg_match($pattern, $string, $matches);
How do I load the text from the text file into the string variable?