<?php $string = ' background: url(../../path/image1.png); background: url(../../../path/image2.png); background: url(../../../path/image3.png); '; echo preg_replace('/\(\K[\/.]+/', '../', $string);
You have javascript disabled. You will not be able to edit any code.