<?php
$text = "Контактные email: test@gmail.com и test1@gmail.com";
$reg = '/([a-zA-Z0-9+.-]+)@([a-z.-]+)/';
for ($i = 0; $i <= $count; $i++) {
echo $matches[0][$i]."\n";
}
PD9waHAKJHRleHQgPSAi0JrQvtC90YLQsNC60YLQvdGL0LUgZW1haWw6IHRlc3RAZ21haWwuY29tINC4IHRlc3QxQGdtYWlsLmNvbSI7CiRyZWcgPSAnLyhbYS16QS1aMC05Ky4tXSspQChbYS16Li1dKykvJzsKJG1hdGNoZXMgPSBhcnJheSgpOwokY291bnQgPSBwcmVnX21hdGNoX2FsbCgkcmVnLCAkdGV4dCwgJG1hdGNoZXMpOwpmb3IgKCRpID0gMDsgJGkgPD0gJGNvdW50OyAkaSsrKSB7CgllY2hvICRtYXRjaGVzWzBdWyRpXS4iXG4iOwp9