我遇到此错误消息:
WEIRD Parse error: syntax error, unexpected 'if' (T_IF) ERROR LINE 11
代码是这样的:
foreach($admins as $admin){
echo "
<tbody>
<tr>
<td>".++$menuCounter."</td>
<td><a href='adminprofile.php?user_name=".$admin['user_name']."'>".$admin['user_name']."</a>
</td>
<td><a id='myModal1' href='mailto:".$admin['email_address']."' target='_top'>".$admin['email_address']."</td>
<td>".$admin['date_joined']."</td>
<td>".$admin['group_admin']."</td>
<td>";if($admin['admin_level'] == 0 || if($admin['admin_level'] == 1 || $admin['admin_level'] == 9)
{
echo "<a href='admindelete.php?table_id=".$admin['table_id']."'><span class='label label-danger'>REMOVE</span></a></td>";
}
else
{
echo "";
}
echo "
</tr>
</tbody>
";
}
第11行是:
<td>";if($admin['admin_level'] == 0 || if($admin['admin_level'] == 1 || $admin['admin_level'] == 9)
那是什么问题?
答案 0 :(得分:0)
您可以在同一if
语句中使用多个条件
更改
if($admin['admin_level'] == 0 || if($admin['admin_level'] == 1 || $admin['admin_level'] == 9)
收件人
if($admin['admin_level'] == 0 || $admin['admin_level'] == 1 || $admin['admin_level'] == 9)