RE: [PHP] how a function 'return' statement works

From: Date: Thu, 14 Feb 2002 16:59:28 +0000
Subject: RE: [PHP] how a function 'return' statement works
Groups: php.general 
Request: Send a blank email to php-general+get-84766@lists.php.net to get a copy of this message
How about: return $current_page_name[count($current_page_name)-1]; -----Original Message----- From: Erik Price [mailto:pricee@hhbrown.com] Can anyone give my puny mind an explanation as to why the following function only returns the value "Array" ? # =============================================================== # get_current_page_name() # --------------------------------------------------------------- # Returns the current document # Arguments # ----------- # no arguments # =============================================================== function get_current_page_name() { $current_page_name = explode("/", $_SERVER['PHP_SELF']); $current_page_name = array_slice($current_page_name, -1); return $current_page_name; }

« previous php.general (#84766) next »