得到PHP Parse错误语法错误,意外的'foreach'(T_FOREACH)

时间:2016-05-10 21:04:51

标签: javascript php angularjs json post

我正在尝试从json数据生成一个表格,我从一个角度js网络应用程序发送,每个循环为我建立一个表格,以便我可以将电子邮件发送给用户。

               $message = "
               </tr>
                </thead>"
                foreach ($dateils as $key=>$di) {
               " <tr >
                    <td>".$key."</td>
                    <td>".$di.typeo."</td>
                    <td>".$di.stypeo."</td>
                    <td>".$di.Diameter."</td>
                    <td>".$di.leghtn."}</td>
                    <td>".$di.amount."</td>
                </tr>"
                    }"
            </table>";

现在是实际循环,这里是顶部

    $inputStream = file_get_contents("php://input");
    $data = json_decode($inputStream);

    $username = $data->username;
    $email = $data->email;
    $company= $data->company;
    $mobile = $data->mobile;
    $delivery = $data->delivery;
    $dateils = $data->details;

从angular am发送两个json对象

   var transporter = []; 
    transporter.use = user;
    transporter.detail = nxt;

0 个答案:

没有答案