check if variable empty

前端 未结 12 1321
旧时难觅i
旧时难觅i 2020-11-27 14:00
if ($user_id == NULL || $user_name == NULL || $user_logged == NULL) {
    $user_id = \'-1\';
    $user_name = NULL;
    $user_logged = NULL;
}
if ($user_admin == NUL         


        
12条回答
  •  旧巷少年郎
    2020-11-27 14:27

    The best and easiest way to check if a variable is empty in PHP is just to use the empty() function.

    if empty($variable) then ....

提交回复
热议问题