//Replaces the url('*') and url("*") with the correct paths $output = preg_replace('/url\(\"(.*?)\"\)/' , 'url(\"'.$styleFolder.'/\1\")', $output); $output = preg_replace('/url\(\'(.*?)\'\)/' , 'url(\''.$styleFolder.'/\1\')', $output);