Another q, this time eregi_replace
| From: | James, Yz | Date: | Sun, 14 Jan 2001 22:05:17 +0000 |
| Subject: | Another q, this time eregi_replace | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-34504@lists.php.net to get a copy of this message | ||
I'd like to be able to trim out some html tags, but only certain ones. I've
used eregi_replace before and have some replacements running on some
scripts...
Some of the help pages and user notes on the quick reference functions have
given me good examples of how to go about it. One thing I'm interested in,
though, is the syntax that's used to determine what the link URL is and the
link name... I think I saw it as:
//0 for the URL and then //1 for the link..... Like this (poor code, I
dunno whether I've even got the right delimiters):
eregi_replace("/<a
href=\"//0\"/>//1/<//a/>\","//1",$string);
I'd like to strip out everything but the link name, so if someone inputs:
<a href="http://www.php.net">PHP!</a>
It replaces it with:
PHP!
Thanks, again. I seem to be asking a lot of questions today, hehe ;)
James.