$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: testing <test@gmail.com>' . "\r\n";
$subject = "testing";

$content = "

//html content

question How to use foreach loop inside this ?



You use it outside and just add the variable that carries the result of the loop, for example:

$rows = '';

foreach($result as $row)
    $rows .= "

$content = "

    <p>Display order list:</p>



Please: next time define the question outside the code block.

its for an invoice so the foreach part must create again and again.So its not possible to use the foreach outside

thank you brooooooooooooooo........Its working