小妹请问如何获取http地址 preg_match('(http://.*?/)','http://news.sohu.com/s2008/reform30/',$m);echo $m[0]; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 parse_url专门处理此事<?Php $arrUrl=parse_url("http://news.sohu.com/s2008/reform30");print_r($arrUrl);//Array ( [scheme] => http [host] => news.sohu.com [path] => /s2008/reform30 )?> $_SERVER["SERVER_NAME"] 这样只能扑获到news.sohu.compreg_match('(http://.*?/)','http://news.sohu.com/s2008/reform30/',$m);echo $m[0];这样的方法固然好!但是我这个地址http://news.sohu.com/s2008/reform30/又如何扑获那! 试试:echo 'http://'.$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"]; 支持,用parse_url/pathinfo搞一搞 PHP连接MYSQL 结果网页无法显示(windows7) 求php4连接mysql5不成功原因? 請高手幫忙! 關于網頁制作的一些小問題 mysql在运行,但总会链接出错的问题 这样的效果可以做出来么? 怎么让一个网站过一个小时自动关闭?而不用按关闭按钮? 问个关于mssql取得查询结果长度被截的问题 关于mail(), 有关asp和php? php 中的 unset() 函数是什么意思? 通过查询读取DZ数据库数据乱码(内有详细说明) 很好的教程
专门处理此事<?Php $arrUrl=parse_url("http://news.sohu.com/s2008/reform30");
print_r($arrUrl);//Array ( [scheme] => http [host] => news.sohu.com [path] => /s2008/reform30 )
?>
echo $m[0];这样的方法固然好!但是我这个地址http://news.sohu.com/s2008/reform30/又如何扑获那!
echo 'http://'.$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"];