$title = $_POST['title']; $post = stripslashes($_POST['TextArea']); $link = preg_replace('"(http://www\S+)"','<a href="$1">$1</a>', $post); echo $link;
After submitting my form above the script, replace all links inside textarea and the result for the images should be broken.
Is there a way to replace links, but not images?
While url works fine, result for images in browser
<img src="<a href="http://...myimage.jpg"">http://.../myimage.jpg"</a> height="150" width="150">


thanks
source share