Explanation of Boolean variables of PHP Data types

Source: Internet
Author: User
Abstract: Boolean type is used to control the process. When two objects are compared, you can use "" to determine whether it is true. In addition, when using a Boolean variable for process control, you can directly use it without comparing it with the true keyword, as shown in program 2-4 .... Boolean is the simplest type. Boolean indicates True or False, which can be True or False. To specify a variable as a Boolean value, use the True or False keywords. both variables are case insensitive, as shown below:
$ Flag = TRUE; // assign TRUE to the variable $ flag
?>

Boolean type is used to control the process. When comparing two objects, you can use "=" to determine whether it is true. In addition, when using a Boolean variable for process control, you can directly use it without comparing it with the true keyword, as shown in program 2-4.
$ Action = "show_book ";
$ Show_br = true;
// Use "=" to judge
// Return a Boolean value for if condition branch judgment
If ($ action = "show_version "){
Echo "you selected to display the current version number! ";
}
// The following code is no longer needed
If ($ show_br = true ){
Echo"
\ N ";
}
// Use the simplified judgment method
If ($ show_br ){
Echo"
\ N ";
}
?>

The above is a detailed description of the Boolean variables of the PHP Data type. For more information, see PHP Chinese network (www.php1.cn )!

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.