Hi,
I am trying to display an array in PHP. The array is generated using information taken from the database. As of now, the information is displayed using print_r. The information displayed is:
Array ( [0] => XXX@my.exXu.edu [1] => keXXX0@yaXXX.com [2] => XXXX@gXXXil.com [3] => kXX92@coXXXst.net )
I would like to only display the email addresses on my page. In between each email address, I would like a ";" then a space. So I would like it to display like this:
email1@test.com; email2@test.com; email3@test.com; email4@test.com;
I have been messing with this for a long time but cannot figure it out. The code I am using is:
$sql = "SELECT user_email
FROM " . USERS_TABLE . "
WHERE mailing_list = 1
ORDER BY user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain extra user info type table', '', __LINE__, __FILE__, $sql);
}
$ndetails_xuinfo_types=0;
while ($row = $db->sql_fetchrow($result))
{
$mailing_list_results[] = $row['user_email'];
$ndetails_xuinfo_types++;
}
$db->sql_freeresult($result);
print_r($mailing_list_results);
Thank you!!