I have this code in Codeigniter, but somehow array_merge does not want to work, how is it possible to merge array to the result?
$categories = $this->get_categories();
$data = array();
foreach ($categories as $index) {
$this->db->select('*');
$this->db->from('questions');
$this->db->where('category', $index);
$this->db->order_by('id','RANDOM');
$this->db->limit(3);
$query = $this->db->get();
array_merge_recursive($data, $query->result());
}
return $data;