How to get only the content of an html page, without the tags

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.