Replacing img tags that don't contain http://
Posted: Wed Nov 07, 2007 11:32 pm
I have the following code to replace img tags
What the above does is add the website url infront of the images.
That's all nice and dandy until one image tag already has a domain infront of the image src...
Is there anyway to only make the above happen if it does not detect a http:// or https:// in the src=""?
Code: Select all
$content = preg_replace('#src="([^"]+?)#im', "src=\"".$websiteurl."/$1", $content);That's all nice and dandy until one image tag already has a domain infront of the image src...
Is there anyway to only make the above happen if it does not detect a http:// or https:// in the src=""?