Descriptions of several character processing functions in php

Source: Internet
Author: User
String segmentation and connection functions: Code: arrayexplode (stringdelimiter, stringdata) uses the string dellimiter to split data into an array and returns functions similar to: split () Code: stringimplode (arraydata, stringdellimiter)

String segmentation and connection functions:

Code:
Array explode (string delimiter, string data) uses the string dellimiter to split data into an array and return
Similar function: split () Code:
String implode (array data, string dellimiter) is opposite to explode (). It concatenates an array with dellimiter into a long string.
Function alias: join () Code:
Array split (string pattern, string text [, integer limit]) uses the matching pattern character as the separator and splits the string text into arrays.
Limit: an optional parameter that limits the number of segments to be separated. string codec function: Code:
String addslashes (string text) is returned by adding "" before special characters in string text. Special characters include ('),("),().
Similar function: quotemeta () Code:
The string stripslashes (string text) and addslashes () functions are the opposite. remove the backslash Encoding code:
String quotemeta (string text) is similar to addslashes (). The difference is that its special characters include:. + *? [] ^ () $ Code:
String escapeshellcmd (string command) adds a backslash before all characters that may cause trouble in shell commands.
Used before exec (), system (), and other functions. Code:
String mysql_escape_string (string text) escapes an SQL string to safely use the code for functions related to mysql_query () HTML:
String htmlentities (string text) converts all HTML entity codes:
String htmlspecialchars (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, in addition to converting the above characters, it also converts "and" code:
String trim (string text) removes the empty character code at the start and end of the string text:
String ltrim (string text) removes the empty character code at the beginning of the string text:
String rtrim (string text) removes the empty character code at the end of the string text:
Alias of the string chop (string text) function rtrim ()

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.