PHP: Why missing values in associative array?
<p>Can someone please put me out of my misery and explain why I'm missing the middle value when I  try to push the results of a preg_match into another array? It's either something silly or a vast gap in my understanding. Either way I need help. Here is my code:</p>

<pre><code>&lt;?php 

$text = 'The group, which gathered at the Somerfield depot in Bridgwater, Somerset, 
        on Thursday night, complain that consumers believe foreign meat which has been 
        processed in the UK is British because of inadequate labelling.';

$word = 'the';

preg_match_all("/\b" . $word . "\b/i", $text, $matches, PREG_OFFSET_CAPTURE);

$word_pos = array();


for($i = 0; $i &lt; sizeof($matches[0]); $i++){

    $word_pos[$matches[0][$i][0]] = $matches[0][$i][1];

}



    echo "&lt;pre&gt;";
    print_r($matches);
    echo "&lt;/pre&gt;";

    echo "&lt;pre&gt;";
    print_r($word_pos);
    echo "&lt;/pre&gt;";
</code></pre>

<p>?></p>

<p>I get this output:</p>

<pre><code>Array
(
[0] =&gt; Array
    (
        [0] =&gt; Array
            (
                [0] =&gt; The
                [1] =&gt; 0
            )

        [1] =&gt; Array
            (
                [0] =&gt; the
                [1] =&gt; 29
            )

        [2] =&gt; Array
            (
                [0] =&gt; the
                [1] =&gt; 177
            )

    )

)
Array
(
[The] =&gt; 0
[the] =&gt; 177
)
</code></pre>

<p>So the question is: why am I missing the  [the] => 29?  Is there a better way? Thanks.</p>
