fork download
  1. <?php
  2.  
  3. $data = array();
  4. $fp = fopen('php://stdin', 'r');
  5. while (false !== $row = fgets($fp)) {
  6. if (preg_match_all('/<(\S+)>\s->\s<\1>/', $row, $m)) {
  7. foreach ($m[1] as $email) {
  8. $data[] = $email;
  9. }
  10. }
  11. }
  12. if (!feof($fp)) {
  13. exit('Error');
  14. }
  15. print_r($data);
Success #stdin #stdout 0.01s 20520KB
stdin
<a@b> -> <c@d>, <e@f> -> <e@f>, 
<g@h> -> <g@h>, <i@j> -> <i@j>,
<k@l> -> <m@n>,
stdout
Array
(
    [0] => e@f
    [1] => g@h
    [2] => i@j
)