Php: problem with associative arrays
<p>If i have an array with hundreds of random ids (having values too) like</p>

<pre><code>(3=&gt;23,2=&gt;34,17=&gt;670,5=&gt;67...)
</code></pre>

<p>how can i get an output like following via a loop</p>

<pre><code>ID: 3 has a value= 23
ID: 2 has a value= 34
ID: 17 has a value= 670
ID: 5 has a value= 67
</code></pre>

<p>I can reference the values by their IDs like</p>

<pre><code>  echo $myArray['3'];
</code></pre>

<p>but what if don't know in advance that what the next ID is? I mean how can i reference the IDs automatically with a loop? Is it even possible to code the following pseudo code in php?</p>

<pre><code>myArray's first location's ID has value = $myArray[$myArray's first location item]
myArray's 2nd location's ID has value = $myArray[$myArray's 2nd location item]
</code></pre>

<p>Need help plz...</p>
