PHP Array to email

Ask about general coding issues or problems here.

Moderators: macek, egami, 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:

Re: PHP Array to email

Post by simplypixie » 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

Re: PHP Array to email

Post by MeroD » 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

Who is online

Users browsing this forum: No registered users and 3 guests