mcandrey wrote:... or you can use the folowing:
smm wrote:The problem with $_SERVER['PHP_SELF']; is that it returns the whole location. Do you know how to just return the file name? Even better, the file name without postfix like .php? Im working on a photo gallery, and the filename should help me refer to both file, picture, thumbnail, and comment function..
substr(basename($_SERVER['PHP_SELF']),0,strlen(basename($_SERVER['PHP_SELF'])) - 4)
$fileshards = array_reverse(split("\.", basename($_SERVER['PHP_SELF'])), false);
print strtolower($fileshard); // should output your filename as long as there is only 1 period
Users browsing this forum: No registered users and 2 guests