note 26573 deleted from function.basename by maxim

From: Date: Tue, 05 Nov 2002 17:26:24 +0000
Subject: note 26573 deleted from function.basename by maxim
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-39000@lists.php.net to get a copy of this message
I've found the easiest way to get a dynamic filename is with $var = basename ($_SERVER["PHP_SELF"],".php"); No REGEXes, no arrays, no registered globals. 8) This is especially handy in files that get included in other files (e.g. class objects), because the superglobal assumes the value of the includING page instead of the includED one, so you end up with a file that dynamically reassigns (in a manner of speaking) the value of $_SERVER[PHP_SELF].

« previous php.notes (#39000) next »