<分区>
Possible Duplicate:
How to parse HTML with PHP?
我想写一个 php 程序来计算一个网站的所有超链接,用户可以输入。
如何做到这一点?有没有我可以解析和分析有关超链接的 html 的库或其他东西?
谢谢你的帮助
<分区>
Possible Duplicate:
How to parse HTML with PHP?
我想写一个 php 程序来计算一个网站的所有超链接,用户可以输入。
如何做到这一点?有没有我可以解析和分析有关超链接的 html 的库或其他东西?
谢谢你的帮助
最佳答案
像这样
<?php
$site = file_get_contents("someurl");
$links = substr_count($site, "<a href=");
print"There is {$links} in that page.";
?>
关于php - 计算网站的超链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7599205/