有一个session的数组存有数据
现在要把这个数组的数据用mail发送到邮箱
能使用for的遍历把数组的数据放在 mail($to, $subject, $message, $headers); 的$message里面吗?尝试使用 $message = "
<html>
<head>
</head>
<body>
<table border='2'>
<tr>
<th>Product Name</th>
<th>Unit Price</th>
<th>Order NO.</th>
<th>Total Price</th>
</tr>
for ($i=0;$i<sizeof($_SESSION['name']);$i++){
print "<tr><td>".$_SESSION['name'][$i];"</td>";
print "<td> $ " .$_SESSION['prce'][$i];"</td></tr>";
print "<td>".$_SESSION['fld1'][$i];"</td></tr>";
$prce = $_SESSION['prce'][$i];
$quan = $_SESSION['fld1'][$i];
$total = $quan * $prce;
echo "<td> $ " .$total; </td></tr>";
}
</table>
</body>
";
发现不行.
求助..
现在要把这个数组的数据用mail发送到邮箱
能使用for的遍历把数组的数据放在 mail($to, $subject, $message, $headers); 的$message里面吗?尝试使用 $message = "
<html>
<head>
</head>
<body>
<table border='2'>
<tr>
<th>Product Name</th>
<th>Unit Price</th>
<th>Order NO.</th>
<th>Total Price</th>
</tr>
for ($i=0;$i<sizeof($_SESSION['name']);$i++){
print "<tr><td>".$_SESSION['name'][$i];"</td>";
print "<td> $ " .$_SESSION['prce'][$i];"</td></tr>";
print "<td>".$_SESSION['fld1'][$i];"</td></tr>";
$prce = $_SESSION['prce'][$i];
$quan = $_SESSION['fld1'][$i];
$total = $quan * $prce;
echo "<td> $ " .$total; </td></tr>";
}
</table>
</body>
";
发现不行.
求助..
for ($i=0;$i <sizeof($_SESSION['name']);$i++){
$message.=$_SESSION['name'][$i];
$message.=$_SESSION['prce'][$i];
..........}mail($to, $subject, $message, $headers);
$mess='';
foreach($_SESSION['mame'] as $key=>$value){
$mess .=$value;
}
echo $mess;