note 100401 deleted from function.key by danbrown
| From: | danbrown@php.net | Date: | Wed, 13 Oct 2010 21:48:40 +0000 |
| Subject: | note 100401 deleted from function.key by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-173194@lists.php.net to get a copy of this message | ||
Note Submitter: marx
----
Dallas' solution is not a very effective one.
Instead of using:
<?php
foreach($row as $value){
echo "\"".key($row)."\"";
next($row);
}
?>
... you can use:
<?php
foreach($row as $key => $value)
{
echo "\"$key\"";
}
?>