<?php $in = 'item1, item2, item3'; $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.