Emails and php

I have a website page with a list of items for sale with a checkbox next to each. When the user selects these they are taken to a page which displays a list of the items that have selected and the price total using a php for loop which iterates through all the items and displays details on those selected.

I want to be able to send this information in an email to the site owner but am totally stuck. I am sure there is something simple I am missing. I can email all the additional info but can’t work out how to get the looped info in the email. Can anyone enlighten me?

Well the body of the email is a string. So at some point you’ll need to loop over an array like structure, and append the related info to the string that makes up the email message body.


<?php
$items[] = array('quantity'=>1, 'name'=>'Great product'),
$items[] = array('quantity'=>3, 'name'=>'Something Wonderful'),
$items[] = array('quantity'=>1, 'name'=>'Toothpicks'),

$message = "Hi Owner, someone is placing an order for the following:\\r\
\\r\
";

foreach($items as $i) {
   $message .= "$i[quantity] of $i[name] \\r\
";
}