note 28185 added to function.token-name
| From: | -petej-at-shaman-dot-ca at rack1 dot php dot net | Date: | Sun, 05 Jan 2003 06:56:15 +0000 |
| Subject: | note 28185 added to function.token-name | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-41681@lists.php.net to get a copy of this message | ||
Use this function's returned array to find token names more quickly and reduce function call
overhead when doing large numbers of lookups.
function get_token_map()
{
$constants = get_defined_constants();
foreach($constants as $key=>$value)
{
if (preg_match('/^T_/', $key))
{
$token_map[$value] = $key;
}
}
return $token_map;
}
--
http://www.php.net/manual/en/function.token-name.php
http://master.php.net/manage/user-notes.php?action=edit+28185
http://master.php.net/manage/user-notes.php?action=delete+28185
http://master.php.net/manage/user-notes.php?action=reject+28185