php使用函数pathinfo()、parse_url()和basename()解析URL
(编辑:jimmy 日期: 2025/4/20 浏览:3 次 )
本文主要介绍的是php使用函数pathinfo()
、parse_url()
和basename()
解析URL的实例代码,下面话不多说,直接来看代码
实例代码如下:
1、利用pathinfo解析URL
<"http://localhost/index.php"); print_r($test); "htmlcode">Array ( [dirname] => http://localhost //url的路径 [basename] => index.php //完整文件名 [extension] => php //文件名后缀 [filename] => index //文件名 )2、利用parse_url()函数解析
<"http://localhost/index.php"); print_r($test); "htmlcode">Array ( [scheme] => http //使用什么协议 [host] => localhost //主机名 [path] => /index.php //路径 [query] => name=tank&sex=1 // 所传的参数 [fragment] => top //后面根的锚点 )3、使用basename()解析
上一篇:php对接java现实加签验签的实例<"http://localhost/index.php"); echo $test; "htmlcode">index.php"color: #ff0000">总结以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流。
下一篇:php实现的网页版剪刀石头布游戏示例
在去年的5月23日,借助Intel Bridge Technology以及Intel Celadon两项技术的驱动,Intel为PC用户带来了Android On Windows(AOW)平台,并携手国内软件公司腾讯共同推出了腾讯应用宝电脑版,将Windows与安卓两大生态进行了融合,PC的使用体验随即被带入到了一个全新的阶段。