fork(1) download
  1. <?php
  2. $re = '/(.+)\n\n/';
  3. $str = "first string\n\nsecond string\n\nother strings bla bla bla";
  4. if (preg_match($re, $str, $matches))
  5. echo $matches[1];
  6. else
  7. echo "nope";
  8. ?>
  9.  
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
first string