I am working with this structure of URL:
http://www.domain.com/Dir1/Dir2/Dir3/Dir4/index.php
and am trying to extract Dir4 into a variable, i.e. $directory=Dir4
I've used this:
$url = getenv("REQUEST_URI");
$root = dirname($url);
to get
$root = Dir1/Dir2/Dir3/Dir4
but am not sure how to pull out that last directory. Any suggestions?
Thanks