If this is my url I am running the script in
http://aq.gthex.co.uk:10000/webcontent/mylogin.php
and I want to find the part called webcontent
use the script below to find this part.
1 2 3 4 5 6 |
$path = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $array = explode('/',$path); $count = count($array); $actualurl = $array[$count-2]; |
The result will be: webcontent