I've got a css string like this :
$string = "div#test {background: url(images/test.gif); width:100px; } div#test2 {background: url(../images/test2.gif); } ";
Basically I want to able to replace everything between url () to just the filename. So that it eventually looks like :
$string = "div#test {background: url(test.gif); width:100px; } div#test2 {background: url(test2.gif); } ";
Sort of like applying basename but for relative urls and for all such instances.
Any ideas ?