note 26808 added to function.array-keys
| From: | michielbakker at msn dot com | Date: | Wed, 13 Nov 2002 15:45:57 +0000 |
| Subject: | note 26808 added to function.array-keys | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-39449@lists.php.net to get a copy of this message | ||
If you receive a bunch of variables and like to change most of them (or all of them for that
matter), you can do something like this: (data has been sent to a page with POST)
<?
$allKeys = array_keys($HTTP_POST_VARS);
for ($i=0;$i<count($allKeys);$i++)
{
$$allKeys[$i] = strtoupper($HTTP_POST_VARS[$allKeys[$i]]);
}
?>
This makes caracters (a-z) uppercase. This is just one way to use it, ofcourse.
Hope this helps someone understand the way to use array_keys() or give any ideas. :)
--
http://www.php.net/manual/en/function.array-keys.php
http://master.php.net/manage/user-notes.php?action=edit+26808
http://master.php.net/manage/user-notes.php?action=delete+26808
http://master.php.net/manage/user-notes.php?action=reject+26808