PHP Learning Record (i)

Source: Internet
Author: User

1. Variable names must be identified by $, and variable names are case- sensitive . Example: $var _name = "Apple";

2. The "Var_dump" function can display the data type of our variables (described in the following section).

3. Memory_get_usage (): Gets the memory consumed by the current PHP.

4, Var_dump (): You can print out the type of data.

5, when we use the "echo" command to Output a Boolean type, if "true" then the output is "1", "false" will not output anything. We can use the "var_dump" function to get its true data type.

6. String: The $ variable inside the single quotation mark (' ') is not parsed into a string, and the $ variable inside the double quotation mark ("") is replaced with the variable content.

7, String: The large length of the string can be expressed in the form of a qualifier:<<< delimiting the string delimiter;

8, special type-resources: PHP can read, use, release files.

9. Special type-NULL type: null, case insensitive. Three values are null: The assignment is null, the variable is not assigned, and the variable is unset ().

10. Constants: Use define () to customize constants: Define (constant name, constant value [, case sensitive]).

11, System constants: Common are: __file__ (current PHP file name), __line__ (the number of lines in the current code), Php_version (PHP version number), Php_os (the current PHP environment of the operating system).

11. Read the Custom constants: Use the constant name directly, or use the constant function. Constant (constant name);

12, defined () function: Determine whether the constant is defined: defined (variable name), the return value is True/false.

13, assignment Operator: = Assignment: Assigns a value to the left variable. & Assignment: Two variables point to the same memory address.

14. In PHP,! = and <> are not equal.

15. String Link: link operator ".". and the. = operator.

16. Error control operator: @: puts @ before an expression, indicating that an error caused by an expression is ignored. If the track_error is turned on, it will be recorded in the $php_errormsg (PHP.ini settings, will be overwritten by subsequent errors).
Use code to open Track_error:ini_set (' track_errors ', 1);

17. Array Loop: Foreach Loop.      Do not remove the subscript: foreach (array as value) {}. Remove the subscript: foreach (array as subscript = = value) {};

PHP Learning Record (i)

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.