title: in_array() codeginter PHP
body: <p>hello members a anomaly in codeigniter im noticing</p>
  
  <p>in my model im querying the database to get a list of user_id ONLY</p>
  
  <pre><code>$recs = $this-&gt;db-&gt;query('select id from users');
  </code></pre>
  
  <p>that was easy, but i want to return the result as an array</p>
  
  <p>so i do </p>
  
  <pre><code>$reccs-&gt;result_array();
  </code></pre>
  
  <p>but now in my controller i want to check for in_array(124,$returned_array);
  this is not successful because codeigniter has encapsulated the array of id into a v big outer array something like this </p>
  
  <pre><code>Array ( [0] =&gt; Array ( [id] =&gt; 0 ) [1] =&gt; Array ( [id] =&gt; 11 )           [2]  =&gt;   Array ( [id] =&gt; 29 )) 
  </code></pre>
  
  <p>how can i use the in_array php function to check only id ?</p>
  
  <p>OR </p>
  
  <p>how can i built a plain array just to store id something like</p>
  
  <pre><code> $demo = array();
   foreach($recs as $r)
   $demo = array($r-&gt;id);
  </code></pre>
  
  <p>Any suggestions ?</p>