PHP Array to email

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
simplypixie
php-forum Active User
php-forum Active User
Posts: 300
Joined: Sun Dec 11, 2011 12:51 am
Location: Shrewsbury, Shropshire
Contact:

Thu Nov 08, 2012 11:44 pm

It is very difficult to advise without seeing how you are generating your emails but what you do need to use is a foreach

Code: Select all

foreach ($_POST['i_have'] as $ihave) {
$html .= $ihave;
}

MeroD
New php-forum User
New php-forum User
Posts: 53
Joined: Wed Oct 10, 2012 12:14 am

Thu Nov 08, 2012 11:56 pm

You can also use the implode() function to join them in a comma separated string:

$checked = trim(stripslashes(implode(",", $_POST['i_have'])));

Post Reply