weird behavior of json_encode function
<p>I have this normal array name $arr..
and trying to push something on the array using array_push() function.. like <code>array_push( $arr['alerts_data'], 999 );</code>
It produces this output:</p>

<pre><code>Array
(
    [alerts_data] =&gt; Array
        (
            [0] =&gt; 169
            [1] =&gt; 175
            [2] =&gt; 111
            [3] =&gt; 48
            [4] =&gt; 999
        )

)
</code></pre>

<p>When i use json_encode I got:</p>

<pre><code>{"alerts_data":[169,175,111,48,111,999]}
</code></pre>

<p>BUT, when I try to unset() something from $arr like:</p>

<pre><code>unset( $arr['alerts_data'][4] );// will remove removes the 999
</code></pre>

<p>and then use the json_encode again, I got this json object</p>

<pre><code>{"alerts_data":{"0":169,"1":175,"2":111,"3":48}}
</code></pre>

<p>What's wrong in here? can you tell? I want to achieve the first encoded json above by using the unset() function.</p>
