Home  >  Article  >  Backend Development  >  ThinkPHP learning--a complete collection of PHP string processing functions

ThinkPHP learning--a complete collection of PHP string processing functions

WBOY
WBOYOriginal
2016-07-29 08:56:111071browse

A Complete Collection of PHP String Processing Functions

I just read a good summary article - A Complete Collection of PHP String Processing Functions

Share it:

addcslashes — Add backslash escape characters to some characters in the string
addslashes — Escape characters in the string in a specified way
bin2hex — Convert binary data to hexadecimal representation
chop — Alias ​​function of rtrim()
chr — Returns the ASCII code of a character
chunk_split — Splits the string into small pieces according to a certain character length
convert_cyr_string — Converts Cyrillic characters to other characters
convert_uudecode — Decrypts a string
convert_uuencode — Encrypt a string
count_chars — Return the character usage information in a string
crc32 — Calculate the crc32 polynomial of a string
crypt — One-way hash encryption function
echo — Used to display some content
explode — Convert a The string is converted into an array form using the delimiter
fprintf — Returns the data as required and writes it directly to the document stream
get_html_translation_table — Returns the HTML entity that can be converted
hebrev — Converts the Hebrew-encoded string into visual text
hebrevc — Convert Hebrew-encoded strings to visual text
html_entity_decode — The inverse function of htmlentities () function, convert HTML entities into characters
htmlentities — Convert some characters in the string to HTML entities
htmlspecialchars_decode —htmlspecialchars( ) function, convert HTML entities into characters
htmlspecialchars — Convert some characters in a string to HTML entities
implode — Convert an array into a string using a specific delimiter
join — Convert an array into a string, implode Alias ​​of the () function
levenshtein — Calculate the difference between two words
localeconv — Get the format definition related to numbers
ltrim — Remove the blanks or specified characters on the left side of the string
md5_file — Encrypt a file with the MD5 algorithm
md5 — Encrypt a string with MD5 algorithm
metaphone — Determine the pronunciation rules of a string
money_format — Format the output of numbers according to parameters
nl_langinfo — Query language and local information
nl2br — Change the newline character in the string " n" is replaced with "
"
number_format — formatted output of numbers according to parameters
ord — converts an ASCII code into a character
parse_str — converts a string in a certain format into variables and values
print — used to output a single value
printf — display the data as required
quoted_printable_decode — encrypt a string into an 8-bit binary string
quotemeta — escape several specific characters
rtrim — remove characters The space on the right side of the string or the specified character
setlocale — Set the local format for numbers, dates, etc.
sha1_file — Encrypt a file with the SHA1 algorithm
sha1 — Encrypt a string with the SHA1 algorithm
similar_text — Compare two characters String, returns the number of similar characters that the system considers
soundex — determines the pronunciation rules of a string
sprintf — returns the data as required, but does not output
sscanf — can format the string
str_ireplace — like str_replace() The function matches and replaces strings in the same way, but is not case-sensitive
str_pad — pads both sides of the string
str_repeat — repeatedly combines strings
str_replace — matches and replaces strings
str_rot13 — performs ROT13 encryption on the string Processing
str_shuffle — Randomly sort the characters in a string
str_split — Split a string into an array according to the character spacing
str_word_count — Get the English word information in the string
strcasecmp — Compare the size of the string, no Case-sensitive
strchr — Alias ​​for the strstr() function that returns part of a string by comparison
strcmp — Compares the size of a string
strcoll — Compares the size of a string according to local settings
strcspn — Returns the length of consecutive non-matching characters The value of
strip_tags — removes HTML and PHP code from a string
stripcslashes — unescapes the addcslashes() function to escape the processed string
stripos — finds and returns the position of the first match, matching is not case-sensitive
stripslashes — Anti-escaping addslashes() function to escape processed strings
stristr — Returns parts of a string through comparison, case-insensitive comparison
strlen — Gets the encoded length of a string
strnatcasecmp — Uses natural The sorting method compares the size of strings, and is not case-sensitive.
strnatcmp — uses the natural sorting method to compare the size of strings.
strncasecmp — compares the size of the first N characters of the string, which is not case-sensitive.
strncmp — compares characters. Compare the size of the first N characters of the string
strpbrk — Return a part of a string by comparison
strpos — Find and return the position of the first match
strrchr — Return a part of a string by comparing from back to front
strrev — Arrange all the letters in the string in reverse order
strripos - Search from back to front and return the position of the first match, matching is not case sensitive
strrpos - Search from back to front and return the position of the first match
strspn — Match and return the value of the length of consecutive occurrences of characters
strstr — Return part of a string by comparison
strtok — Split a string by a specified number of characters
strtolower — Convert a string to lowercase
strtoupper — Convert a string Convert to uppercase
strtr — compare and replace strings
substr_compare — compare truncated strings
substr_count — count the number of occurrences of a certain character segment in the string
substr_replace — replace some characters in the string
substr — Truncate the string
trim — Remove the blanks or specified characters on both sides of the string
ucfirst — Convert the first letter of the given string to uppercase
ucwords — Convert the first letter of each English word in the given string letters become uppercase
vfprintf — Return the data as required and write it directly into the document stream
vprintf — Display the data as required
vsprintf — Return the data as required, but do not output it
wordwrap — Follow certain characters Length split string

The above introduces ThinkPHP learning - a complete collection of PHP string processing functions, including various aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn