Play PHP must know PHP common symbols and Functions _php tutorial

Source: Internet
Author: User
Tags autoload string format
Recently in the writing PHP program found some special PHP symbols, such as continuous less than the symbol, three less than the symbol, eot,eod,echo example, print example, and suddenly found that with so long PHP, even PHP basic symbols are not recognized all, See the @ is also checked for a long while to know what meaning. Put the basic symbols and some of the common PHP symbols outside the ice bar into a list, in my blog post it, the need for friends can refer to the PHP related special symbols ~ Note symbols://single-line Comments * * */Multiline annotated quotation marks using ' single quote, Without any meaning, take it directly over any treatment; "" Double quotes, PHP dynamic processing then output, typically used for variables. Variable morphology: One is true, that is true; The other is false, which is a common variant: string strings (numbers \ Kanji \ et cetera) integer integers (1, 2, 3, 4, 5, 0, 1, 2, and so on) double floating-point number (decimal point) The array of object objects can be used with Getty PE ($MIX) and Settype ($mix, $typename); Common symbol \ "double quotation mark \ \ \ backslash \ n" send out \ t-hop (TAB) operation symbol + addition operation – subtraction operation * Multiplication/division operation% Plus remainder + + cumulative – minus 1. Add string to set operation = Put the value on the right side to the left (must be) + = Add the right value to the left-side value to the left *= the left side of the value to the right side/= the left value to the right. = Add the right string to the left operator & | or ^ Mutex (XOR) << left shift >> right Shift ~ Take 1 of the complement logical operation < less than > greater than <= less than or equal to >= greater than equals = = Not equal to && and | | Or! No other operation symbol $ variable symbol & variable indicator (before variable) @ Do not display error message (added before function) The method or property of the object--the element value of the array? : Ternary operator Basic method 1.PHP convert string to case! Strtolower (); Turn the character into lowercase strtoupper (); Capitalize the character to the 2.PHP encrypted string (both uppercase and lowercase) MD5 (), encrypt SHA1 (), encrypt 3. About quotation marks one, the single quotation mark is the output two, the double quotation mark is the content explanation carries on the output three, the inverted single quotation mark is executes a command, like 'PWD '. Four, "\" role in the translation of characters, such as "\ n" for line-wrapping! 4. Function: Htmlspecialchars () This function turns special characters into HTML string format (&....;). The most commonly used occasion may be to deal with the message of the customer message version. & (And) Turn & "(double quotation mark) to" < (less than) turn to <> (greater than) turn to > This function converts only the special characters above and does not convert all of the ASCII conversions that are determined by the HTML. 5. Batch Output HTML content! echo <<< eothtml Output content ... Here the comment output! EOT; Print << ”. File_get_contents ($FileName). "”;} Else{echo "No";}? > 7. Unload variable unset; Unset ($var); unset ($var, $var 1); 8.is_int; Detects whether the variable is an integer, 9.is_null, whether the variable is null, whether the 10.is_string detection variable is the alias of the String 11.is_real;is_float () 12.isset detects if the variable is set 13.is_ Whether the bool detection variable is a Boolean 14.is_array detection variable is an array 15.is_object the detection 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"), which turns the escaped newline into HTML
Original: Http://y312ff.blog.163.com/blog/static/12701109420119119575812/lazycms:: $sysname The first time to see this way of expression, what is the meaning of double colon? Answer: A method or property of a direct genus. That is, static method or property use. Domain operators, which are generally used to use the Class A object's properties/Methods in Class B objects! Class C{private static $_memory; public static function AutoLoad () {//Method body}} C::$_memory;c:: AutoLoad ();

http://www.bkjia.com/PHPjc/477870.html www.bkjia.com true http://www.bkjia.com/PHPjc/477870.html techarticle recently in the PHP program to find some special PHP symbols, such as continuous less than the symbol, three less than the symbol, eot,eod,echo example, print example, and suddenly found a long time in PHP ...

  • 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.