Liquid1ce
09-07-2004, 09:18 AM
Anyone tell me how i can do this:
i need to replace both IMG SRC & HREF but i need to make it into 1 line as it doesnt accept 2 lines?
bleh if you can understand ? :)
$newcode = preg_replace("/(IMG SRC=\"?)(\/[^\"\/]+)/", "\\1" . $domain . "\\2", $code);
$newcode = preg_replace("/(HREF=\"?)(\/[^\"\/]+)/", "\\1" . $domain . "\\2", $code);
thnx
i need to replace both IMG SRC & HREF but i need to make it into 1 line as it doesnt accept 2 lines?
bleh if you can understand ? :)
$newcode = preg_replace("/(IMG SRC=\"?)(\/[^\"\/]+)/", "\\1" . $domain . "\\2", $code);
$newcode = preg_replace("/(HREF=\"?)(\/[^\"\/]+)/", "\\1" . $domain . "\\2", $code);
thnx