Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当您将链接放入消息中时,我希望实现 facebook 的效果 - 他们会从中刮取标题和一些图像。我注意到他们也做得非常快。(他们必须缓存一些重新发送的项目?)
有人对如何使用 PHP 解决这个问题有任何想法吗?我可以<title>在不卷曲整个内容的情况下以某种方式快速抓取页面块吗?
<title>
谢谢!
您可能必须抓取整个页面并使用HTML DOM 解析器来撕掉标题标签。
就像你说的,如果你想要更快的速度考虑缓存结果。
http://simplehtmldom.sourceforge.net/