Adding elements to an array via array_push
<p>Am trying to push elements to an <code>array</code> but they fail</p>

<p>This is what i have tried:</p>

<pre><code>  $relations=['0'=&gt;''];
    $hhrelations = Tblsuhhrelationship::model()-&gt;findAll();
    foreach ($hhrelations as $key=&gt;$hhrelation){

       array_push($relations, $hhrelation['description'],(int)$hhrelation['hh_relation_id']);

     }
   var_dump($relations)
</code></pre>

<p>This generates an array in this form:</p>

<pre><code>  1 =&gt; string 'Head' (length=4)
   2 =&gt; int 1
  3 =&gt; string 'Spouse' (length=6)
  4 =&gt; int 2
  5 =&gt; string 'Child (own/Step)' (length=16)
  6 =&gt; int 3
  7 =&gt; string 'Parent/Parent in-law' (length=20)
  8 =&gt; int 4
  9 =&gt; string 'Brother/Sister' (length=14)
 10 =&gt; int 5
  11 =&gt; string 'Other Relatives' (length=15)
  12 =&gt; int 6
  13 =&gt; string 'Unrelated' (length=9)
  14 =&gt; int 7
</code></pre>

<p>I would like it to be:</p>

<pre><code>  1 =&gt; string 'Head' (length=4)
  2 =&gt; string 'Spouse' (length=6)
  3 =&gt; string 'Child (own/Step)' (length=16)
  4 =&gt; string 'Parent/Parent in-law' (length=20)
  5 =&gt; string 'Brother/Sister' (length=14)
//Others continue this way
</code></pre>

<p>Where the values <code>1,2,3..</code> are given by <code>$hhrelation['hh_relation_id']</code></p>

<p>And the strings are given by <code>$hhrelation['description']</code></p>

<p>How do i modify this?</p>