$str = "http://www.baidu.com/s?ie=utf-8&bs=php+cookie+%E9%BB%98%E8%AE%A4%E6%97%B6%E9%97%B4&f=8&rsv_bp=1&rsv_spt=3&wd=php+session+%E5%AD%98%E5%82%A8%E4%BD%8D%E7%BD%AE&rsv_sug3=16&rsv_sug=0&rsv_sug1=15&rsv_sug4=344&inputT=11791";
preg_match_all('#https?://(.*?)($|/)#m',$str,$match);
echo "<pre>";
var_dump($match);
echo "</pre>";
PHP Regex Domain
最新推荐文章于 2024-11-14 15:22:28 发布