I have this code which sends an e-mail with some information in it. The message part is like below:
$mail->Body =<<<MSG
<html>
<head>
<title>Statistics</title>
</head>
<body>
The start was: {$start} </br></br>
The end was: {$end} </br></br>
</body>
</html>
MSG;
I have an array named $events which I want to include in the message, but I want to display it as a table, as below
$mail->Body =<<<MSG
<html>
<head>
<title>Statistics</title>
</head>
<body>
The start was: {$start} </br></br>
The end was: {$end} </br></br>
foreach ($events as $event)
{
echo '<tr>';
echo '<td>' . $event)[1] . '</td>';
echo '<td>' . $event)[2] . '</td>';
echo '<td>' . $event)[3] . '</td>';
echo '</tr>';
}
</body>
</html>
MSG;
Can you please help me with the syntax of foreach?