I was looking into stripping HTML files that contain alot of links. I
was trying to avoid the manual way of data entry. The contents i need
are the name of the link (plain text which sits out side the HTML code)
and all the a href tags. I would like the a href (ie.the hyperlink)
tags to be
Hi Charles,
Not sure exactly what you are after, but
function displayLinks ($pagecontents) {
$search = '/a (.*?)href=(.*?)(.*?)\/a/im';
$replace = 'a
$1href=recordstep.php?clientid=$clientidtestid=$testidlink=$2$3/a';
return (preg_replace ($search, $replace,
Either the ereg_replace, eregi_replace, or preg_replace has a full working
script that does this, returning pretty much plain text.
There's also the strip_tags()/striptags() function which strips out all PHP
and HTML tags -- perhaps not enough, nice you'd want to remove *some* other
stuff maybe,
3 matches
Mail list logo