3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $in = 'item1'; $out = preg_replace('/ ?([^,]+),?/', '$1 <img src="$1.png" alt="" />', $in); echo $out;
Output for 4.3.0 - 7.1.0
item1 <img src="item1.png" alt="" />