0
我正在获取页面的源代码,但是如何通过语法突出显示器来获取它,然后将其吐出?如何从网站获取源代码并通过'highlight_string'?
<?php
echo htmlentities(file_get_contents('http://www.example.com/post/'));
highlight_string('http://www.example.com/post/');
?>
我正在获取页面的源代码,但是如何通过语法突出显示器来获取它,然后将其吐出?如何从网站获取源代码并通过'highlight_string'?
<?php
echo htmlentities(file_get_contents('http://www.example.com/post/'));
highlight_string('http://www.example.com/post/');
?>
此功能不正是你想要什么: highlight_file($文件名)
php.net/highlight_file
highlight_string只有colorizes PHP代码不是你的网站加载的file_get_contents与HTML哪。这是有用的http://www.php.net/manual/de/function.highlight-string.php#81257 – Bernhard
你不能得到源 –