Hi, I was wondering the best way to extract the first directory after the web site root (e.g. http://www.example.com/exampledir1/exampledir2/... - I want to extract the exampledir1 part).
Any help much appreciated. Thanks 🙂
$url = preg_split("/\//i", $_SERVER['REQUEST_URI'], -1, PREG_SPLIT_NO_EMPTY);
Thanks 🙂