Skip to content

Instantly share code, notes, and snippets.

@rmasters
Created May 2, 2011 00:23
Show Gist options
  • Save rmasters/951025 to your computer and use it in GitHub Desktop.
Save rmasters/951025 to your computer and use it in GitHub Desktop.
<?php
$array = array(
array("id" => 1, "user" => "Ross"),
array("id" => 2, "user" => "Adam"),
array("id" => 3, "user" => "Ben")
);
$iterator = new RecursiveArrayIterator($array);
foreach ($iterator as $key => $value) {
echo "Index: $key\n";
var_dump($value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment