Php text processing string and string functions

Source: Internet
Author: User
Tags crc32 md5 hash sha1 hash
PHP extension text processing-string and string functions are all string functions processed in various ways. There are also some special chapters in the regular expression and URL processing sections.

For more information about the operating mechanism of strings, especially about single quotes, double quotation marks, and escape sequences, see string entries.

String functions:

Addcslashes-escape characters in strings using backslash in the C-language style

Addslashes-use a backslash to reference a string

Bin2hex-Convert binary data to hexadecimal representation

Alias of chop-rtrim

Chr-return the specified character

Chunk_split-splits a string into small parts

Convert_cyr_string-converts a character from one Cyrillic to another.

Convert_uudecode-decodes a uencode string

Convert_uuencode-encode a string using uuencode

Count_chars-returns the characters used by the string.

Crc32-calculate the crc32 polynomial of a string

Crypt-unidirectional String hash

Echo-output one or more strings

Explode-use one string to separate another string

Fprintf-Write formatted strings to the stream

Get_html_translation_table-return the conversion table after using htmlspecialchars and htmlentities

Hebrev-convert the logical sequence Hebrew (logical-Hebrew) to the visual sequence Hebrew (visual-Hebrew)

Hebrevc-converts the logical sequence Hebrew (logical-Hebrew) to the visual sequence Hebrew (visual-Hebrew), and converts the line break

Hex2bin-convert a hexadecimal string to a binary string

Html_entity_decode-Convert all HTML entities to their applicable characters

Htmlentities-Convert all applicable characters to HTML entities

Htmlspecialchars_decode-converts special HTML objects back to common characters

Htmlspecialchars-Convert special characters to HTML entities

Implode-convert the value of a one-dimensional array to a string

Join-alias implode

Lcfirst-lowercase for the first character of a string

Levenshtein-calculates the editing distance between two strings

Localeconv-Get numeric formatting information

Ltrim-removes spaces (or other characters) starting with a string)

Md5_file-calculate the MD5 hash value of the specified file

Md5-calculate the MD5 hash value of a string

Metaphone-Calculate the metaphone key of a string

Money_format-Formats a number as a currency string

Nl_langinfo-Query language and locale information

Nl2br-insert the HTML line feed mark before all new lines of the string

Number_format-format a number using a thousands separator

Ord-returns the ASCII value of a character.

Parse_str-parses a string into multiple variables.

Print-output string

Printf-output formatted string

Quoted_printable_decode-Convert a quoted-printable string to an 8-bit string

Quoted_printable_encode-Convert a 8 bit string to a quoted-printable string

Quotemeta-Quote meta characters

Rtrim-removes white spaces (or other characters) at the end of a string)

Setlocale-Set locale information

Sha1_file-calculate the sha1 hash value of the file

Sha1-calculate the sha1 hash value of the string

Similar_text-calculate the similarity between two strings

Soundex-Calculate the soundex key of a string

Sprintf-Return a formatted string

Sscanf-parses input characters according to the specified format

Str_getcsv-parses a CSV string as an array

Case-insensitive version of str_ireplace-str_replace

Str_pad-use another string to fill the string with the specified length

Str_repeat-repeat a string

Str_replace-substring replacement

Str_rot13-execute the ROT13 conversion on the string

Str_shuffle-randomly disconnects a string

Str_split-convert string to array

Str_word_count-returns the usage of words in the string

Strcasecmp-binary security comparison string (case insensitive)

Strchr-alias strstr

Strcmp-binary security string comparison

Strcoll-string comparison based on region settings

Strcspn-get the length of the starting substring of the unmatched mask

Strip_tags-remove HTML and PHP tags from strings

Stripcslashes-references a string escaped using addcslashes

Stripos-locate the first occurrence of a string (case insensitive)

Stripslashes-references a reference string

The stristr-strstr function is case-insensitive.

Strlen-get the string length

Strnatcasecmp-use the natural order algorithm to compare strings (case insensitive)

Strnatcmp-use a natural sorting algorithm to compare strings

Strncasecmp-several characters starting with a binary security comparison string (case insensitive)

Strncmp-several characters starting with a binary security comparison string

Strpbrk-find any character of a group of characters in a string

Strpos-locate the first occurrence of a string

Strrchr-find the last occurrence of a specified character in the string

Strrev-reverse string

Strripos-calculate the position of the last occurrence of the specified string in the target string (case insensitive)

Strrpos-calculate the position of the last occurrence of the specified string in the target string

Strsps-calculate the length of the first substring in a string that contains all characters in the specified character set.

Strstr-first appearance of the search string

Strtok-mark the delimiter

Strtolower-converts a string to lowercase

Strtoupper-converts a string to uppercase

Strtr-conversion of specified characters

Substr_compare-binary secure comparison string (compare the specified length from the offset position)

Substr_count-calculates the number of times a string appears.

Substr_replace-replace the substring of a string

Substr-returns the substring of the string.

Trim-removes spaces (or other characters) at the beginning and end of the string)

Ucfirst-converts the first letter of a string to uppercase

Ucwords-converts the first letter of each word in a string to uppercase

Vfprintf-Write formatted strings to the stream

Vprintf-output formatted string

Vsprintf-returns the formatted string

Wordwrap-the interrupt string is a specified number of strings.

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.