PhoenixBlue PhoenixBlue - 3 months ago 26
PHP Question

output html page after rendering

Good day all!

I would like to be able to get contents of an HTML document after rendering, using PHP. example, if I have this HTML document:

<html>
<head>
<script>
function(){
/* some dummy code here*/
}
</script>
</head>
<body>
<form>
<div>
<a href="some_links"> click here friend </a>
<input type="button" />
<p>Lorem ipsum dolor sit atmen</p>
</div>
</form>
</body>
</html>


the output of the function should look like:

click here friend

Lorem ipsum dolor sit atmen

Thanks in advance for your help!
Note: please do not care much about this HTML code, it's just an example

Answer

Output buffering should do the job:

<?php
   ob_start();
?>

all of your HTML

<?php
   $content = ob_get_content();
    echo strip_tags($content);
?>