Sort out two pieces for everyone to learn
1. Differences between three equal signs and two equal signs "=" VS "="
For example, a function returns the following results:
1. number greater than 0
2. Number smaller than 0
3. number equal to 0 (that is, 0)
4. False (upon failure)
In this case, if you want to capture the failure, you must use = instead of =
Because = matches 4th cases and 3rd cases, because 0 is false!
Next
$ A = '2'; // balanced type 2
$ B = 2; // numeric type 2
$ A = $ B, yes, both are 2
$ A ===$ B, which is incorrect because $ a is numeric and $ B is Numeric. Although the values are the same, they are of different types.
2. What are the three angle brackets in php? "<"
Copy codeThe Code is as follows:
$ Somevar = <someword
Put your code or words here
Someword;
This is a code snippet. One advantage of using code segments in PHP is that when you need to output a piece of code (including multiple lines), the code segment can maintain a more logical form. It is often used to insert HTML code.
Note that someword is any character, indicating a mark. <Someword indicates that the tag starts, and the last someword indicates that the code segment ends. And this someword must be written in the top level (there cannot be any characters such as spaces or tabs in front)
It can be used to assign values that contain both single quotes and double quotes.