fork(1) download
  1. <?php
  2. $text = "Контактные email: test@gmail.com и test1@gmail.com";
  3. $reg = '/([a-zA-Z0-9+.-]+)@([a-z.-]+)/';
  4. $matches = array();
  5. $count = preg_match_all($reg, $text, $matches);
  6. for ($i = 0; $i <= $count; $i++) {
  7. echo $matches[0][$i]."\n";
  8. }
Success #stdin #stdout #stderr 0.04s 52480KB
stdin
Standard input is empty
stdout
test@gmail.com
test1@gmail.com

stderr
PHP Notice:  Undefined offset: 2 in /home/bHI4Lm/prog.php on line 7