php的判断语句怎么写,想在$comment['comment_rank']里边加个判断$comment_type = $comment['comment_type'];$id_value = $comment['id_value'];$email = $comment['email'];$user_name =$comment['user_name'];$content =$comment['content'];$comment_
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/24 01:03:26
php的判断语句怎么写,想在$comment['comment_rank']里边加个判断$comment_type = $comment['comment_type'];$id_value = $comment['id_value'];$email = $comment['email'];$user_name =$comment['user_name'];$content =$comment['content'];$comment_
php的判断语句怎么写,想在$comment['comment_rank']里边加个判断
$comment_type = $comment['comment_type'];
$id_value = $comment['id_value'];
$email = $comment['email'];
$user_name =$comment['user_name'];
$content =$comment['content'];
$comment_rank =$comment['comment_rank'];
$add_time =$comment['add_time'];
/*$ip_address =$comment['comment_rank'];*/
$status =$comment['status'];
$parent_id =$comment['parent_id'];
$user_id =$comment['user_id'];
怎样在里边加个判断语句
判断$comment['comment_rank']的值等于1,$ip_address值就等于1
$comment['comment_rank'] 的值等于2或者3,$ip_address值就等于2
$comment['comment_rank']的值等于4或者5,$ip_address值就等于3
php的判断语句怎么写,想在$comment['comment_rank']里边加个判断$comment_type = $comment['comment_type'];$id_value = $comment['id_value'];$email = $comment['email'];$user_name =$comment['user_name'];$content =$comment['content'];$comment_
switch ($comment['comment_rank'])
{
case 1:
$ip_address =1;
break;
case 2:
$ip_address =2;
break;
case 3:
$ip_address =2;
break;
case 4:
$ip_address =3;
break;
case 5:
$ip_address =3;
break;
default:
echo "$comment['comment_rank']的值已超过5";
}