<?php
$text = "background: url(img/back.gif)";
$pattern = '/^background: url\(img\/back.gif\)/';
$text = preg_replace($pattern, "background: url(../img/back.gif)", $text);
echo $text;
?>
dostum "back.gif" sadece bir örnekti. bir css dosyasında bir sürü image olabilir.