|
When you are in a function and you want to know what it is called / named, PHP has a variable called __FUNCTION__ which will return the name of the function / method you are currently in. This is very helpful for debugging as well as when you are writing SEF urls in CAKEPHP.
PHP has different more variables like this called.
PHP MAGIC CONSTANTS __DIR__ - Returns the directory of the file you are currently in __CLASS__ - Returns the current class name __FILE__ - Returns the current file's name __LINE__ - Returns the line where you are currently in the file returned in __FILE__ __METHOD__ - Returns the method name as declared __NAMESPACE__ - Returns the name of the current namespace
By PHPin24 @ 2009-07-28 10:59:41
|