fork download
  1. <?php
  2.  
  3. var_dump(preg_match("/\$\nSecond/", "First line\nSecond line"));
  4. var_dump(preg_match("/\$\nSecond/m", "First line\nSecond line"));
  5.  
  6. // another way to prove the same
  7. var_dump(preg_match_all('/line$/', "First line\nSecond line"));
  8. var_dump(preg_match_all('/line$/m', "First line\nSecond line"));
  9.  
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
int(0)
int(1)
int(1)
int(2)