<p>Is there an easy way to iterate over an associative array of this structure in PHP:</p>

<p>The array <code>$searches</code> has a numbered index, with between 4 and 5 associative parts. So I not only need to iterate over <code>$searches[0]</code> through <code>$searches[n]</code>, but also <code>$searches[0]["part0"]</code> through <code>$searches[n]["partn"]</code>. The hard part is that different indexes have different numbers of parts (some might be missing one or two).</p>

<p>Thoughts on doing this in a way that's nice, neat, and understandable?</p>

You should be able to use a nested foreach statment
from the
php manual
```
```
/* foreach example 4: multi-dimensional arrays */
$a = array();
$a[0][0] = "a";
$a[0][1] = "b";
$a[1][0] = "y";
$a[1][1] = "z";

foreach ($a as $v1) {
    foreach ($v1 as $v2) {
        echo "$v2\n";
    }
}
```
```