Originally posted by konsu
you can use regular expressions.
...more specifically:
$textarea = 'please visit http://www.google.com to search the web';
$textarea = preg_replace('#(http://)([^\s]*)#', '[URL removed]', $textarea);
$textarea = preg_replace('=(www.)([^\s]*)=', '[URL removed]', $textarea);
echo $textarea;