国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

PHP data type NULL type

Empty means null in English, which means nothing. Null is not false, not 0, and not a space.

[Key points] Know the three situations when null occurs, and learn the difference between empty and isset functions.

There are three main situations that will produce a null type:

1. The value of the variable is clearly specified as NULL through variable assignment

2. A variable has no Give any value

3. Use the function unset() to destroy the variable

Let’s demonstrate it with code.

<?php
//聲明變量為null
$n = null;
var_dump($n);
?>
<?php
//var_dump顯示輸出變量$meiyou,看看結果是什么?
var_dump($meiyou);
?>
<?php
//聲明一個變量$iphone的值為字符串的手機
$iphone = '手機';
//unset銷毀掉一個變量unset($iphone);
var_dump($iphone);
?>

Next we will explain two functions related to null. These two functions are very commonly used. We define the level as [default level].

empty() can pass a variable into the middle of the brackets. If the value of this variable is false or null, it returns true.

<?php

$apple = null;
if(empty($apple)){
    echo '執(zhí)行了真區(qū)間,鳳姐,我愛你';
}else{
   echo '行了假區(qū)間,你想鳳姐了';
}
?>

The above experiment proves that $apple is null. Place the apple in the middle of empty. The result is a true interval.

isset() can pass one or more variables between the brackets, separated by commas. As long as there is a variable that is null, it returns false. Otherwise, returns true.

<?php
//待會兒將變量$jia改為null再執(zhí)行看看結果
$jia = false;

$result = isset($jia);

var_dump($result);

?>
<?php
$one = 10;
$two = false;
$three = 0;
$four = null;

$result = isset($one , $two , $three , $four);
//執(zhí)行看看結果,是不是
var_dump($result);

?>

unset() The function of this function is to destroy variables. Insert the variable name you want to destroy between the unset (variable) brackets, and the variable will be destroyed.

English description
unset
Pronunciation: [?n'set]
Explanation: Restoration

Continuing Learning
||
<?php $one = 10; $two = false; $three = 0; $four = null; $result = isset($one , $two , $three , $four); //執(zhí)行看看結果,是不是 var_dump($result); ?>
submitReset Code