Home  >  Article  >  Backend Development  >  PHP study notes 1--20110830_PHP tutorial

PHP study notes 1--20110830_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:45:22869browse

1. Detailed discussion of Boolean types
​ 1.1 The keywords true and false are not case-sensitive.
 
1.2 In PHP programming, the following situations will be treated as false
* 0 means false, non-0 means true
For example: $a=0;
If($a==false)
                                                             {
                                                                                                                                                                                                              to                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       print("true"); The result is: false
* Decimal 0.0 means false, if the decimal is not 0.0, it is true
* The empty string "" or "0" also means false, otherwise it means true
* null means false
*An array that does not contain any elements also means false
2. Detailed discussion of strings
2.1. A string consists of multiple characters, one character occupies one byte
For example, $a = "abc"; the variable $a occupies three bytes
In 2.2 PHP, there is no theoretical limit to the size of the string, it depends on the size of the memory.
2.3 Two ways to define a string
3.3.1 Single quotes $a='abc';
3.3.1 Double quotes $a="abc";
                                                                                                                                                                                                                                                                   will treat $xxx as a variable when outputting, while ’       will treat $xxx as a string
2.4 The escape character used in "" is
3.Type description of php variables
The conclusion is: the type of PHP variables is not determined by the programmer, but is determined by the context when PHP is executed


This article comes from the blog "ITeamsky-Yang Bo's Technology Space"


http://www.bkjia.com/PHPjc/478671.html

www.bkjia.com

http: //www.bkjia.com/PHPjc/478671.htmlTechArticle1. Detailed discussion of Boolean types 1.1 The keywords true and false are not case-sensitive. 1.2 In PHP programming, the following situations will be treated as false * 0 means false, non-0 means true. For example: $a=0...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn