PHP null Empty value (GO)

Source: Internet
Author: User
Null (NULL): A special data type in PHP that represents a null value, which means that no value is set for the variable null (null value) is case-insensitive, and null and NULL are the same.
There are three possible cases where a null value is assigned: There is no value assigned to it, null value is empty, and variables processed by the unset () function (Source: PHP from Beginner to Mastery) P47.

Examples are as follows:
The echo "variable ($string 1) is directly assigned null";
$string =null; $string 1 is assigned a null value
$string 3= "str"; $string 3 is assigned str
if (Is_null ($strig 1=null)) {//Determine if $string1 is empty
Echo ' String=null ';
}
Echo '

';
echo ' Variable ($string 2) is not assigned ';
if (Is_null ($string 2=null)) {//Determine if $string1 is empty
Echo ' String=null ';
}
Echo '

';
Echo ' was released by Unset ($string 3): ';
Unset ($string 3);
if (Is_null ($string 3=null)) {//Determine if $string1 is empty
Echo ' String=null ';
}
?>

Browser processing results:
Variable ($string 1) is directly assigned to Nullstring=null
Variable ($string 2) is not assigned String=null
Variable ($string 3) released by Unset (): String=null

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.