blorriman
asked on
Codeigniter convert array to string
I think this is a really stupid question, but I'm trying to get all the email addresses from a database into a string so I can send an email to everyone in the database (it never gets bigger than 25 emails) by using $list ($this->email->to($list)), instead of using a foreach which is slow because it has to send each email.
Here's a simple test that shows there are 8 rows, but $list->result_array() just displays Array and print_r($list) shows all the information.
My question is how do I into a string ($list) that I can use for $this->email->to($list) ?
Here's a simple test that shows there are 8 rows, but $list->result_array() just displays Array and print_r($list) shows all the information.
My question is how do I into a string ($list) that I can use for $this->email->to($list) ?
function get_emails() {
$this->db->select('email');
$list = $this->db->get('users');
echo $list->num_rows() . '<br />';
echo $list->result_array() . '<br />';
print_r($list) . '<br />';
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.