PHP Knowledge Point (2)-string function

Source: Internet
Author: User

HTML-related functions addslashes ();    //', ' ", \,null plus backslash stripslashes (); Htmlentities (); Html_entity_decode (); Htmlspecialchars (); Htmlspecialchars_decode (); nl2br (); Strip_tags ();  CHR ();    //converts ASCII code to character Ord ();    //converts characters to ASCII code value  implode ();    = join (); explode (); Str_split ();            //returns the string to the array chunk_split () by the specified length;    //splits a string into small chunks at a specified length, followed by an end (default "\ r \ n")   de-whitespace and string-fill function trim (), LTrim (), RTrim (), Str_pad (String, Length,pad_str,flag);        //fills string strings with pad_str to length, if no pad_str is specified, padding with spaces, flag specifies whether to fill left, right, or both sides, default right     Str_repeat (Input,times);        //returns input repeating the Times string  number_format (); Money_format ();  md5 (); SHA1 ();   str_replace (a);    //replaces 1 in string 3 with 2str_ireplace ();   strstr (); =STRCHR ();        //Returns the string that is searched for the first occurrence to the end of the string, returns the string type Stristr (), STRRCHR ();                    //returns the character or string that was found to the end of the string Strpos ();                    //returns the position of the first occurrence of the found character or string, and returns the int type Stripos (); Strrpos () ; Strripos ();  substr (string,start,length);    //Returns a string of length lengths from Start strlen ();  strcmp ();                    //binary security comparison, return to 1,-1,0STRCASECMP ();            //ignoring case strnatcmp ();              //by natural sort comparison strnatcasecmp ();        
STRNCMP (); Binary security compares several characters at the beginning of a string, and the functionstrcmp ()Similarly, the difference is that you can specify the length to use for two string comparisons (that is, the maximum comparison length). Note that the comparison is case-sensitive. STRNCASECMP (); Strtolower (); Strtoupper ();

Ucword ();

Ucfirst ();        Capitalize the first character of the string, and the following characters are output lcfirst ();        The first character of a string is lowercase, and the following character remains output Strrev (); Invert string

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.