RalfGesellensetter schrieb:
Am Montag 11 September 2006 15:36 schrieb Merlin:
I am trying to strip URL's out of a text. There is a function for
this in php, but I can't find it anywhere. Can sombody help?
hi, it's strip_tags and only removes the tags (<a href ...) but keeps
the plain text that would be displayed in a text browser.
Hi there,
thank you for the hint. This it the one I was searching for. However
unfortunatelly the function also strips all other tags! I am looking for
one that only does strip the <a href tag.
I am not so familar with regex, but I fear I would need to :-(
My guess is that it must be something like this:
$str = 'foo <a href="">test</a> o';
$str = preg_replace('<a (.*)', '', $str);
echo $str;
Can anybody help me on that? Thank you so much in advance.
Regards,
Merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php