Re: [PHP] How can I strip the code from HTML pages to extract thecontents of a HTML page.

2002-08-29 Thread Charles Fowler
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

Re: [PHP] How can I strip the code from HTML pages to extract thecontents of a HTML page.

2002-08-29 Thread Todd Pasley
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,

Re: [PHP] How can I strip the code from HTML pages to extract thecontents of a HTML page.

2002-08-28 Thread Justin French
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,