| 域名空间 下载中心 社区论坛 信息公告 my小屋 |
![]() |
联系我们 设为首页 加入收藏 |
|
首页 | 新闻资讯 | 编程开发 | 网页设计 | 图形图象 | 网络媒体 | 网站模板 | 数 据 库 | 投稿 论坛 | 操作系统 | 系统优化 | 网络安全 | 黑客技术 | 硬件学堂 | 硬件报价 | 服 务 器 | 地图 专题 | 应用软件 | 聊天通讯 | q q 专栏 | 建站经验 | 在线工具 | 站长club | 注 册 表 | 旧版 社会 | 游戏娱乐 | 设计欣赏 | 疑难解答 | 社区论坛 | 韩国素材 | 素材图库 | 广告服务 | 服务 |
| 新版上线![旧版] | |||||
注:打开慢时请稍等
如何读取比如http://abc@xxx.com 中的abc?http://www.iyit.net 日期:2006-10-6 15:31:37 来源:iyit.net收集 点击: |
比如http://abc@xxx.com http://admin@xxx.com 上面的abc,admin在php页面中如何读取和区分? --------------------------------------------------------------- parse_url()函数 parse_url (php 3, php 4 ) parse_url -- parse a url and return its components description array parse_url ( string url) this function returns an associative array returning any of the various components of the url that are present. this includes the scheme - e.g. http host port user pass path query - after the question mark ? fragment - after the hashmark # this function is not meant to validate the given url, it only breaks it up into the above listed parts. partial urls are also accepted, parse_url() tries its best to parse them correctly. 例子 1. using parse_url() $ php -r 'print_r( parse_url("http://username:password@hostname/path?arg=value#anchor"));' array ( [scheme] => http [host] => hostname [user] => username [pass] => password [path] => /path [query] => arg=value [fragment] => anchor ) $ php -r 'print_r( parse_url("http://invalid_host..name/"));' array ( [scheme] => http [host] => invalid_host..name [path] => / ) --------------------------------------------------------------- <?php $str="http://abc@cc.dat"; if(ereg( "^http://([a-za-z0-9]+)@[a-za-z0-9]+\.dat",$str,$regs)) echo $regs[1]; else echo "sldjf"; ?> 编辑:黑鹰 [发送给好友] [打印本页] [关闭窗口] [返回顶部] 上一篇:非法字符替换问题 下一篇:先判断要上传的文件的大小再上传文件 转载请注明来源:www.iyit.net 特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。 |
| 相关文章 | ||||
| 友情链接 | ||||||
| 设置首 页 - 版权声明 - 广告服务 - 关于我们 - 联系我们 - 友情连接 |
| |||||||