<?php

error_reporting(-1);

$text = 'Мой e-mail: mymail@mailbox.com, e-mail моего друга: myfriend@mail.ru, e-mail друга моего друга: myfriendsfriend@gmail.com';
$regexp = '/([a-zA-Z0-9_+.-]+)@([a-z.-]+)/';
$matches = array();
$email = preg_match_all($regexp, $text, $matches, PREG_SET_ORDER);
echo "Найдено {$email} почтовых адреса\n";
var_dump($matches);


// your code goes here