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

What Are The Best Universities In The World?

Hard vs. Soft Water: What's The Difference?

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -