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 "user@domain.com MIME-Version: bla bla bla user2@example.com";
$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?