fork download
  1. <?php
  2.  
  3. $string ='<img src="image.jpg" alt=212><img src="http://u...content-available-to-author-only...a.org/wikipedia/commons/e/e5/Raster_to_Vector_Mechanical_Example.jpg" alt=45>';
  4. $pattern = '/(<img src=\")(?!http)/i';
  5. $content = preg_replace($pattern, '$1NEW!', $string);
  6.  
  7. echo $content;
  8.  
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
<img src="NEW!image.jpg" alt=212><img src="http://u...content-available-to-author-only...a.org/wikipedia/commons/e/e5/Raster_to_Vector_Mechanical_Example.jpg" alt=45>