Recently, some special PHP symbols were found when I was writing a PHP program, such as less than the symbol consecutively, three smaller than the symbol, eot, eod, echo, and print, suddenly I found that after using PHP for so long, I didn't even fully recognize the basic symbols of PHP. I saw the @ number and found out what it meant for a long time. put... syntaxHighlighter. all recently found some special PHP symbols when writing PHP programs, such as continuous less than symbol, three less than symbol, eot, eod, echo example, print example, etc, suddenly I found that after using PHP for so long, I didn't even fully recognize the basic symbols of PHP. I saw the @ number and found out what it meant for a long time. sort the basic symbols and some common PHP symbols for ice bars on the outside into a list. post them on my blog. if you need them, refer to the special symbols related to PHP ~ Annotation symbol: // Single line annotation/**/the use of multiple line annotation quotation marks ''single quotes, no meaning, without any processing directly;" "double quotation marks, php dynamically processes and outputs, which are generally used for variables. 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. add the string to the set operation = place the value on the right to the left (always) + = add the value on the right to the left- = Reduce 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 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
Original article: http://y312ff.blog.163.com/blog/static/12701109420119119575812/ lazycms: $ sysname first saw this expression, I would like to ask what is the meaning of double colon answer: directly belongs to the class of the method or attribute. That is, the use of static methods or attributes. Domain operators are generally used to use the attributes/methods of Class A objects in Class B objects! Class c {private static $ _ memory; public static function autoload () {// method body} c ::$ _ memory; c: autoload ();
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.