<?php $filename = '10.jpg'; $size = 'profile'; echo preg_replace('/(\.[^.]*)$/', "-$size$1", $filename); echo "\n"; $filename = 'john.smith.jpg'; $size = 'profile'; echo preg_replace('/(\.[^.]*)$/', "-$size$1", $filename);
You have javascript disabled. You will not be able to edit any code.