如果 URL 如下:
如果: http://www.imvu-e.com/products/dnr/
那么: http://www.imvu-e.com/products/dnr/
如果: http://www.imvu-e.com/products/dnr/?
那么: http://www.imvu-e.com/products/dnr/
如果: http://www.imvu-e.com/products/dnr/index.php
那么: http://www.imvu-e.com/products/dnr/
如果: http://www.imvu-e.com/products/dnr/page.php?var=2
那么: http://www.imvu-e.com/products/dnr/
如果: http://www.imvu-e.com/products/dnr
那么: http://www.imvu-e.com/products/
我怎样才能做到这一点?
我的尝试:
print "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['REQUEST_URI'])."/";