3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr =['img src="images/Selection_005.png"', 'img src="images/Selection_006.png"', '<img src="documents/Selection_005.png" alt="" width="199" height="120" /></p>']; $find = ["images","documents"]; $replace ="/documents/20143/0"; Foreach($arr as $link){ Echo str_replace($find, $replace, $link) ."\n"; }

preferences:
26.07 ms | 404 KiB | 5 Q