mysql - PHP echo results from an array -
i have php code:
while($contacts2=mysql_fetch_array($rs)) { //generate list of emails address in array $emails_list[] = $contacts2["email"]; }
so puts results array when echo $emails_list
outside of while loop displays array
how can make display like:
result1,result2,result3
etc
here answer
while($contacts2=mysql_fetch_array($rs)) { //generate list of emails address in array $emails_list[] = $contacts2["email"]; } $emails_list = implode(',', $emails_list); echo "(". $emails_list . ")";
i think should try this,
$mail->addaddress('person1@domain.com', 'person one'); $mail->addaddress('person2@domain.com', 'person two');
with phpmailer
, can as,
while($contacts2=mysql_fetch_array($rs)) { $mail->addaddress($contacts2['emails'], $contacts2['name']); }
Comments
Post a Comment