fork download
  1. <?php
  2.  
  3. $str = "test-test-3
  4. test-1";
  5. preg_match('/\ntest-(.*)$/mi', $str, $match);
  6. var_dump($match);
Success #stdin #stdout 0.02s 24192KB
stdin
Standard input is empty
stdout
array(2) {
  [0]=>
  string(7) "
test-1"
  [1]=>
  string(1) "1"
}