PHP5 string handling functions

  • 2020-03-31 20:34:02
  • OfStack

Addcslashes - adds backslash escape characters to partial characters in a string
Addslashes - escapes characters in a string in the specified way
Bin2hex - converts binary data into a hexadecimal representation
Chop - alias function for rtrim()
CHR - returns ASCII code for a character
Chunk_split - split the string into small chunks of a certain character length
Convert_cyr_string - converts slough characters to other characters
Convert_uudecode - decrypt a string
Convert_uuencode - encrypts a string
Count_chars - returns information about the use of characters in a string
Crc32 - computes a crc32 polynomial for a string
Crypt - one-way hash encryption function
Echo - to display something
Explode - converts a string to an array using a delimiter
Fprintf - returns the data as required and writes directly to the document stream
Get_html_translation_table - returns HTML entities that can be converted
Hebrev - converts Hebrew encoded strings into visual text
Hebrevc - converts Hebrew encoded strings into visual text
Html_entity_decode - inverse of the htmlentities () function that converts HTML entities to characters
Htmlentities - converts some characters in a string to HTML entities
Htmlspecialchars_decode -- the inverse of the htmlspecialchars() function that converts an HTML entity to a character
Htmlspecialchars - converts some characters in a string to HTML entities
Implode - turns an array into a string with a specific separator
Join - converts the array to a string, alias for the implode() function
Levenshtein - calculate the difference between two words
Localeconv - gets the format definition associated with the number
Ltrim - removes white space or the specified character from the left side of the string
Md5_file - encrypts a file for the MD5 algorithm
Md5 - encrypts a string for the md5 algorithm
Metaphone - determines the pronunciation of a string
Money_format - output that formats Numbers by argument
Nl_langinfo - query language and local information
Nl2br - replace the newline '\n' in the string with '< Br / >"
Number_format - output that formats Numbers by argument
Ord - converts an ASCII code into a character
Parse_str - converts formatted strings to variables and values
Print - to print out a single value
Printf - displays the data as required
Quoted_printable_decode - encrypts a string into an 8-bit binary string
Quotemeta - escapes certain characters
Rtrim - removes white space or specified characters from the right side of the string
Setlocale - sets the local format for Numbers, dates, and so on
Sha1_file - encrypts a file with the SHA1 algorithm
Sha1 - encrypts a string with the sha1 algorithm
Similar_text - compares two strings and returns the number of similar characters the system considers
Soundex - rules for determining the pronunciation of a string
Sprintf - returns the data as required, but not outputs it
Sscanf - can format strings
Str_ireplace - matches and replaces strings like the str_replace() function, but is case-insensitive
Str_pad - whitens both sides of a string
Str_repeat - a repeated combination of strings
Str_replace - matches and replaces strings
Str_rot13 - ROT13 encryption of strings
Str_shuffle - randomly sorts the characters in a string
Str_split - splits a string into an array by character spacing
Str_word_count - gets the English word information in the string
Strcasecmp - compares strings in size, case insensitive
STRCHR - alias to the STRSTR () function that returns part of a string by comparison
STRCMP - compares the size of a string
The strcoll wok compares strings in size based on local Settings
STRCSPN - returns the value of a continuous unmatched length of a character
Strip_tags - removes HTML and PHP code from a string
The stripcslashes - unescapes the addcslashes() function to escape the processed string
Stripos - finds and returns the location of the first match, matching case-insensitive
The stripslashes - unescaped addslashes() function escapes the processed string
Stristr - the part of a string that returns a comparison, case-insensitive
Strlen - gets the encoding length of a string
Strnatcasecmp - USES natural sorting to compare the size of strings, case-insensitive
Strnatcmp - USES natural sorting to compare the size of strings
Strncasecmp - size comparison of the first N characters of a string, case insensitive
STRNCMP - a size comparison of the first N characters of a string
STRPBRK - the part that returns a string by comparison
Strpos - finds and returns the location of the first match
STRRCHR - the part that returns a string by comparing backwards
Strrev - inverts all the letters in a string
Strripos - looks backwards and returns the location of the first match, case insensitive
The strrpos wok looks back and returns the location of the first match
STRSPN - matches and returns the value of the continuous occurrence length of the character
STRSTR - the part that returns a string by comparison
Strtok - splits a string with the specified number of characters
Strtolower - converts strings to lowercase
The strtoupper stream converts strings to uppercase
STRTR - compare and replace strings
Substr_compare - a comparison after intercepting a string
Substr_count - counts the number of occurrences of a character segment in a string
Substr_replace - replaces some characters in a string
Substr - intercepts a string
Trim - removes white space or specified characters from both sides of the string
Ucfirst - converts the first letter of a given string to uppercase
Ucwords - capitalizes the first letter of each English word given to the string
Vfprintf - returns the data as required and writes directly to the document stream
Vprintf - displays the data as required
Vsprintf - returns the data as required, but not outputs it
Wordwrap - splits a string by a certain character length
The strtolower() function capitalizes all characters, the strtoupper() function capitalizes all characters, the ucfirst() function capitalizes the first letter of a given string, and the ucwords() function capitalizes the first letter of every English word given to a string. Ucfirst () deals only with the first character of a string, and ucwords() deals only with the first letter of each word (delimited by a space, "today! "Hi", "today.Hi" will be considered a word), and the case status of the remaining letters will not change.
For more information:
(link: #)

Related articles: