How to get only the content of an html page, without the tags
By liviu - Posted on December 8th, 2008
Tagged:
How to get only the content of an html page, without the tags.
How to remove the tags from an html page.
There is a function in php, strip_tags that does that for you.
Example of tag striping
<?php
$str = <<<EOD
<html>
<head>
</head>
<body>
<p> hello <b>liviu</b>
</body>
</html>
EOD;
echo strip_tags($str);
?>
Also fgetss does this for files, rather easy.
Bookmark/Search this post with:
- liviu's blog
- Login or register to post comments
Delicious
Digg
StumbleUpon
Propeller
Reddit
Magnoliacom
Newsvine
Furl
Facebook
Google
Yahoo
Technorati
Icerocket