美好的一天!
我希望能够在渲染后使用PHP获取HTML文档的内容。例如,如果我有这个HTML文档:
<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>
该函数的输出应如下所示:
点击此处朋友
Lorem ipsum dolor坐在atmen
提前感谢您的帮助! 注意:请不要太在意这个HTML代码,这只是一个例子
答案 0 :(得分:0)
输出缓冲应该完成这项工作:
<?php
ob_start();
?>
all of your HTML
<?php
$content = ob_get_content();
echo strip_tags($content);
?>
答案 1 :(得分:0)