PHP如何在给定字符串中查找出特定两个字符之间的内容?
查询的 ip:219.245.125.100 来自:陕西省西安市 西安电子科技大学
GeoIP: Xidian, China
您今日已查询 14 次,最多可查 100 次。
GeoIP:"之间的“陕西省西安市 西安电子科技大学”,该如何处理?
------解决方案--------------------
$s=<p>查询的 IP:219.245.125.100 来自:陕西省西安市 西安电子科技大学</p><p><span>立即学习</span>“<a href="https://pan.quark.cn/s/7fc7563c4182" style="text-decoration: underline !important; color: blue; font-weight: bolder;" rel="nofollow" target="_blank">PHP免费学习笔记(深入)</a>”;</p><p>GeoIP: Xidian, China</p><p></p><p>您今日已查询 14 次,最多可查 100 次。</p> div; preg_match('/来自:(.*?)<p>/',$s,$m); echo $m[1]; <br><font color="#e78608">------解决方案--------------------</font><br> 将给定字符串保存在$current0中<br><br>$current='preg_match('/来自:(.*?)</p><p>/',$current,$result);<br>echo $result[1]; </p><div class="clear"></div>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号