如果URL如下:PHP 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'])."/";
我確定你的意思是「斜槓」而不是「反斜槓」。 – 2012-07-24 08:16:13
/- 這種斜線:) – 2012-07-24 08:18:00
是的,這是「正斜槓」或者乾脆「斜線」 – 2012-07-24 08:18:19