Description of several character handler functions in PHP _php tutorial

Source: Internet
Author: User
Tags rtrim
String splitting and joining functions:

Array explode (string delimiter, string data) uses the string dellimiter to split data into an array to return
Similar functions: Split () Code:
String implode (array data, String dellimiter) is the opposite of explode (), which joins the array with Dellimiter as a long string
function aliases: Join () Code:
Array split (string pattern, string text[, integer limit]) uses a match pattern pattern character as a delimiter to divide the text of the string into arrays
Limit optional parameters, limiting the number of segments of a split string codec function: code:
String Addslashes (string text) is returned with a "" before the special character in the string text, and special characters include (), ("), ().
Similar functions: Quotemeta () Code:
String Stripslashes (string text) and the addslashes () function are the opposite, removing the backslash code:
String Quotemeta (string text) is similar to Addslashes (), except that its special characters include:. + * ? [] ^ () $ Code:
String escapeshellcmd (String command) adds a backslash to all characters that might cause trouble in a shell command.
Used before functions such as exec (), System (). Code:
String mysql_escape_string (string text) escapes a SQL string to be used safely for mysql_query () HTML-related function code:
String Htmlentities (string text) transforms all HTML entity code:
String Htmlspecialchars (String string [, int quote_style [, String CharSet]]) converts a specific character to an HTML entity
Quote_style: (ent_compat| Ent_quotes)
Quote_style Default value: Ent_compat Conversion & < >
When Quote_style is: ent_quotes, convert the and code in addition to the above characters:
String Trim (string text) removes the null character code at the beginning and end of the string text:
String LTrim (string text) removes the null character code at the beginning of the string text:
String RTrim (string text) removes the null character code at the end of the string text:
The alias of string Chop (string text) function RTrim () true techarticle string splitting and joining functions: Code: Array Explode (string delimiter, String data) uses string Dellimiter to split data into an array to return similar functions: Split () code ...

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