Query regarding associative arrays PHP
<p>I have a question about associative arrays in php.</p>

<p>I have following array in which there are two items named 4 and 2 respectively.</p>

<pre><code>$items = array(4,2);
</code></pre>

<p>Now i want to associate each item's quantity to it which can be done as follows:</p>

<pre><code>$items['4']=23;
$items['2']=0;
</code></pre>

<p>which means that there are 23, 'item 4s' and no 'item 2'.</p>

<p>But I sometimes don't know in advance what is there in the <strong>$items</strong> so i want to associate quantity on basis of location. I wanted to do something like associate 23 to whatever is there on the zero location of the <strong>item</strong> array:</p>

<pre><code>$items['items[0]']=23;
</code></pre>

<p>This of course did not work because its not the right way to extract whatever is placed on the zero location of items. Can anyone please tell me how do i do that?</p>
