note 50143 added to control-structures.foreach
| From: | xardas at spymaccom | Date: | Sat, 19 Feb 2005 15:35:33 +0000 |
| Subject: | note 50143 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-85256@lists.php.net to get a copy of this message | ||
Quote:
-------------------------
It makes sense, since you cannot call only keys from an array with foreach().
-------------------------
Why not?
<?php
foreach(array_keys($array) as $string)
{
print 'array key is '.$string;
}
?>
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50143
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50143&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50143&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50143&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50143&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50143&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50143&report=yes
Search -- http://master.php.net/manage/user-notes.php