简体   繁体   中英

How can I convert CodeIgniter result array to a numeric array?

I was wondering, How can I convert codeigniter query result array to a numeric array?

Should I iterate the whole result array and make a new numeric array or Is there efficient way?

Thank you

You can use this example for your requirement from documentation,

$query = $this->db->query("YOUR QUERY");

foreach ($query->result_array() as $row)
{
        echo $row['title'];
        echo $row['name'];
        echo $row['body'];
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM