note 98335 added to control-structures.foreach
| From: | Kris dot Craig at gmail dot com | Date: | Wed, 09 Jun 2010 18:42:46 +0000 |
| Subject: | note 98335 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169988@lists.php.net to get a copy of this message | ||
If you're looking for a quick and easy way to recursively pull data from an MD array,
here's a little function that should come in handy:
/* Grab any values from a multidimensional array using infinite recursion. --Kris */
function RecurseArray( $inarray, $toarray )
{
foreach ( $inarray as $inkey => $inval )
{
if ( is_array( $inval ) )
{
$toarray = $this->RecurseArray( $inval, $toarray );
}
else
{
$toarray[] = $inval;
}
}
return $toarray;
}
----
Server IP: 208.69.120.55
Probable Submitter: 131.107.0.84
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit -- https://master.php.net/note/edit/98335
Del: integrated -- https://master.php.net/note/delete/98335/integrated
Del: useless -- https://master.php.net/note/delete/98335/useless
Del: bad code -- https://master.php.net/note/delete/98335/bad+code
Del: spam -- https://master.php.net/note/delete/98335/spam
Del: non-english -- https://master.php.net/note/delete/98335/non-english
Del: in docs -- https://master.php.net/note/delete/98335/in+docs
Del: other reasons-- https://master.php.net/note/delete/98335
Reject -- https://master.php.net/note/reject/98335
Search -- https://master.php.net/manage/user-notes.php