php获取网页title问题

2024-11-20 15:35:58
推荐回答(1个)
回答1:

你把$data写入临时文件调试一下看看,究竟是否获得了网页代码,网页代码里面是否有标签,或者是<title>的写法与预期不一致。<br><br>调试语句:<br>file_put_contents('debug.1.txt', $data);<br><br>另外,使用修饰符/s或者/m试试看,有一个的功能是使用.可以匹配回车和换行。</p> </div> </div> <div class="clear"></div> </div> </div> </div> <div class="wendaright"> <div class="wdluluerwema"> <div class="wdxgwttop">相关问答</div> <div class="wdxgwtnr"> </div> <div class="clear"></div> </div> <!-- 其他随机问答['id'=>alphaID($like['zid'])] --> <div class="wdluluerwema"> <div class="wdxgwttop">最新问答</div> <div class="wdxgwtnr"> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://85l.net/l/1988650307587493547.html">php获取网页title问题</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://85l.net/l/1245821112658975499.html">花都湖周边有啥楼盘好一点的?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://85l.net/l/1541625281195409987.html">我在贵阳火车站,要去四大佛教名山旅游,怎么走最省时间,九华山,峨眉山,普陀山,五台山</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://85l.net/l/558441764.html">柳州汽车南站托运要多少钱?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://85l.net/l/1383586773573376340.html">考上研究生想去参加西部计划怎么办?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://85l.net/l/525421273.html">想换手机,小米2好还是Nokia 的lumia 820好?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://85l.net/l/1709309338546984980.html">微波炉怎么烤最简单的饼干</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://85l.net/l/595294581.html">水彩画与油画的区别是什么?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://85l.net/l/1754965525119521388.html">以前看过一部恐怖电影但是忘了叫什么,讲的是一个闹鬼的学校,学生违反校规就会死,有人知道叫什么吗?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://85l.net/l/1703729369476966660.html">征文;我爱祖国,我爱我家.怎么写</a></div> </div> </div> </div> </div> <div class="clear"></div> <div class="footer"> <!-- 移动底部导航 --> <div class="fanhuitop"><a href="#top" ref="nofollow"><img src="https://85l.net/static/old/img/fhtop.png" alt="返回顶部" title="返回顶部"></a></div> <div class="dibu"> <div class="dibu"> </div> </div> <div class="banquan"> <p>内容全部来源于网络收集,如有侵权,请联系网站删除:QQ:24596024</p> </div> </div> </div> </div> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d7381e8e13750926596c531b05a19c89"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> </body> </html>