Re: How to obtain the txt content of an HTML formated document?
| From: | Richard Davey | Date: | Wed, 25 Feb 2004 09:47:56 +0000 |
| Subject: | Re: How to obtain the txt content of an HTML formated document? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-178818@lists.php.net to get a copy of this message | ||
Hello filicicsub,
Wednesday, February 25, 2004, 8:56:36 AM, you wrote:
f> I just wanted to know if there is any easy meant to recover the textual
f> contents of an HTML file. I know It should be easy because PHP have an
f> effective way to handle string discrimination/manipulation... but I'm
f> quite lazy, and I just wanted to know if there is an already made
f> implementation ( I know shame on me...).
If you want to remove all the tags from the HTML document and leave
just the text then load the file in (using file_get_contents() or
fopen()) and then use strip_tags() to clean it up.
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html