Send email with $_POST and multiple checkboxes

     

I've a problem with a form with multiple checkboxes when I have to send an email with the value of the checkboxes.


This is my HTML code  

  

What are your favorite foods?

   Pizza

   Pasta

   Cheese

     


and this is my PHP code


$contactName = $_REQUEST['name'];  $contactEmail = $_REQUEST['email'];  $phone = $_POST['phone'];  $privacy = $REQUEST['privacy'];
$foods = isset($_POST['foods']) ? $_POST['foods'] : array();  foreach($foods as $food) {  //echo $food;   exit(); } // IT STAMP JUST ONE VALUE IVEN IF I CHECKED MORE THAN ONE.. THIS IS THE PROBLEM
  // FOR THE EMAIL  $nomeAdmin = "my admin name";  $emailAdmin = "my admin email";  $subject_admin = "this is the subject";  $body_admin = "This is the body:
   Name: ".$contactName."
   E-mail: ".$contactEmail."
   Phone: ".$phone."
   Favourite foods: ".$food;
if (($contactName=="") || ($contactEmail=="") || ($privacy=="") || ($food=="")) {   echo "";  } else { This is the php mailer code }  

Thanks so much!!!