note 92567 added to function.array-keys
| From: | falkon303 at gmail dot com | Date: | Wed, 29 Jul 2009 17:34:01 +0000 |
| Subject: | note 92567 added to function.array-keys | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-158887@lists.php.net to get a copy of this message | ||
Here's a simple way to loop through the array keys without using print_r in case anyone is
looking for it.
<?
// Code written by Ben Althauser... //
$array = array (
'COUNTRY' => 'Country of Origin',
'NAME' => 'Full Name',
'TITLE' => 'Title',
'SHOESIZE' => 'Shoe Size',
);
$arkeys = array_keys($array);
foreach($arkeys as $i => $arkeys[$i])
{
echo $arkeys[$i]."<br>";
}
?>
----
Server IP: 64.71.164.2
Probable Submitter: 71.37.40.169
----
Manual Page -- http://www.php.net/manual/en/function.array-keys.php
Edit -- https://master.php.net/note/edit/92567
Del: integrated -- https://master.php.net/note/delete/92567/integrated
Del: useless -- https://master.php.net/note/delete/92567/useless
Del: bad code -- https://master.php.net/note/delete/92567/bad+code
Del: spam -- https://master.php.net/note/delete/92567/spam
Del: non-english -- https://master.php.net/note/delete/92567/non-english
Del: in docs -- https://master.php.net/note/delete/92567/in+docs
Del: other reasons-- https://master.php.net/note/delete/92567
Reject -- https://master.php.net/note/reject/92567
Search -- https://master.php.net/manage/user-notes.php