How to get string on path in php? -


i got path variable in array.

$url = "http://$_server[http_host]$_server[request_uri]"; $a = parse_url($url); print_r($a); 

$a's output=>

 array ( [scheme] => http [host] => localhost [path] => /countersistemi/hero/earthshaker/ )  

i want earthshaker in array.

try:

echo basename($a['path']); 

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -