Common PHP symbols and functions

Source: Internet
Author: User
Variable form: True or False; False is False. common variable form: string (numbers, Chinese characters, etc) integer (1, 2, 3, 4, 5, 0,-1,-2, and so on) double floating point number (decimal point) array object method available... "> <LINKhref =" http: // www. php1

 

Variable form: True or False; False is False. common variable form: string (numbers, Chinese characters, etc) integer (1, 2, 3, 4, 5, 0,-1,-2, etc.) double floating point number (decimal point) the methods available for array object objects include gettype ($ mix) and settype ($ mix, $ typename ); common symbols \ "double quotes \ backslash \ n line feed \ r output \ t hop (TAB) operator Number + addition operation-subtraction operation * multiplication operation/division operation % remainder operation + + accumulation-subtraction 1. set the string addition operation = place the value on the right to the left (Yes) + = add the value on the right to the left-= decrease the value on the right to the left * = multiply the value on the left by the value on the right/= and divide the value on the left by the value on the right. = add the string on the right to the left operator operation & and | or ^ mutex (xor) <shift to left> Shift to the right ~ The complement logical operation of 1 is <less than> greater than <= less than or equal to> = greater than or equal! = Not equal to & and | or! No other operator number $ variable symbol & variable indicator (before the variable) @ do not display error information (before the function)-> object method or attribute => array element value? : Basic method of ternary computation. 1. PHP converts strings to uppercase and lowercase! Strtolower (); convert character to lower case strtoupper (); convert character to upper case 2. PHP encrypted string (case sensitive) md5 (); encrypted sha1 (); encrypted 3. quotation marks 1, single quotation marks are output as is 2, double quotation marks are content interpretation for output 3, and single quotation marks are executed as a command, such as 'pwd '. 4. "\" acts on translated characters. for example, "\ n" is a line break! 4. function: htmlspecialchars () this function converts special characters into HTML strings (&....; ). The most common use case may be the message board for handling customer messages. & (And) to & "(double quotation marks) to" <(less than) to <> (greater than) to> This function only converts the preceding special characters, not all are converted to the ASCII conversion defined in HTML. 5. batch output HTML content! Echo <EOTHTML output content... // Comments are output here! EOT; Print <". File_Get_Contents ($ FileName )."";}Else {Echo" no ";}?> 7. unset; unset ($ var); unset ($ var, $ var1); 8. is_int; check whether the variable is an integer; 9. is_null; check whether the variable is NULL; 10. is_string checks whether the variable is a string 11. is_real; alias of is_float () 12. isset check whether the variable is set 13. is_bool checks whether the variable is Boolean 14. is_array checks whether the variable is an array. is_object checks whether the variable is an object 16. subStr. SUBSTR (String, Start, SelectNum) echo substr ('abcdef', 1); // bcdefecho substr ('abcdef', 1, 3 ); // bcdecho substr ('abcdef', 0, 4); // abcdecho substr ('abcdef', 0, 8); // abcdefecho substr ('abcdef',-1, 1); // f17.Nb2brecho nl2br ("foo isn't \ n bar"); convert the escape line to HTML

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.