note 69709 deleted from function.array-shift by nlopess
| From: | nlopess@php.net | Date: | Sun, 17 Sep 2006 09:57:40 +0000 |
| Subject: | note 69709 deleted from function.array-shift by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-117255@lists.php.net to get a copy of this message | ||
Note Submitter: giuseppe at http://www dot wsarea dot com
----
Simple method to get page name (may not work with url_rewrite on):
$_page_name = $_SERVER['SCRIPT_NAME']
if(strstr($_page_name,'.')) $_page_name =
array_shift(explode('.',$_page_name));
if(strstr($_page_name,'/')) $_page_name =
array_pop(explode('/',$_page_name));
Example:
'index.php' => 'index'