title: array push in php
body: <p>I have code flow like</p>
  
  <pre><code> $titlecriteria=array();
   $title = new MongoRegex("/^$tag/i");                    
   $titlearray= array("title" =&gt; $title);
   array_push($titlecriteria,$titlearray);
  </code></pre>
  
  <p>consider I have two titles like 'abc','def'</p>
  
  <p>If i do like this, then the $titlecriteria will look like</p>
  
  <pre><code>  array(2) (
      [0] =&gt; array(1) (
     [title] =&gt; MongoRegex object {
      regex =&gt; (string) ^abc 
     flags =&gt; (string) i
       }
     )
     [1] =&gt; array(1) (
     [title] =&gt; MongoRegex object {
      regex =&gt; (string) ^def 
     flags =&gt; (string) i
       }
      )
    )
  </code></pre>
  
  <p>ie the value is inside another array..I also tried array_merge().As the key title is same it takes the last value alone. I need output like</p>
  
  <pre><code>array(2) (
   [title] =&gt; MongoRegex object {
    regex =&gt; (string) ^abc 
    flags =&gt; (string) i
   }
   [title] =&gt; MongoRegex object {
    regex =&gt; (string) ^def 
    flags =&gt; (string) i
   }
  )
  </code></pre>
  
  <p>ie the all the values are in same array. Is this possible? help me out </p>