<?php $in = 'item1'; $out = preg_replace('/ ?([^,]+),?/', '$1 <img src="$1.png" alt="" />', $in); echo $out;
You have javascript disabled. You will not be able to edit any code.