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
Post a Comment