-1) {$slashType = "/";} else {$slashType = "\\";}; $shortURLStarts = explode($slashType,$_SERVER['DOCUMENT_ROOT']); // Then clear item at the end if there is one, plus trailing slash // We end up with the directory name of the server root if ($shortURLStarts[count($shortURLStarts)-1]!="") {$trimArray=1;} else {$trimArray=2;} $shortURLStarts = $shortURLStarts[count($shortURLStarts)-$trimArray]; ?>