fork(1) download
  1. <?php
  2.  
  3. $re = "/bob/";
  4. $str = "joe,bob,luis,sancho,bob,marco,lura,hannah,bob,marco,luis";
  5. echo $result = preg_replace($re, 'found it!', $str, 1);
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
joe,found it!,luis,sancho,bob,marco,lura,hannah,bob,marco,luis