English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP string functions are part of the core. This function can be used without installation
Version-Represents the earliest version of PHP that supports this function.
Number | Function | Description | Version |
---|---|---|---|
1 | addcslashes() | Return a string with backslashes added before specified characters. | 4 |
2 | addslashes() | Return a string with backslashes added before predefined characters. | 4 |
3 | bin2hex() | Convert a string of ASCII characters to a hexadecimal value. | 4 |
4 | chop() | Remove whitespace characters or other characters from the right side of a string. | 4 |
5 | chr() | Return a character from a specified ASCII value. | 4 |
6 | chunk_split() | Split a string into a series of smaller parts. | 5 |
7 | convert_cyr_string() | Convert a string from one Cyrillic character set to another. | 4 |
8 | convert_uudecode() | Decode strings encoded with uuencode. | 5 |
9 | count_chars() | used to return information about the characters used in the string | 4 |
10 | crc32() | Calculate a string's 32 Bit CRC (Cyclic Redundancy Check). | 4 |
11 | crypt() | It is used to hash a string, a one-way string encryption method. | 4 |
12 | echo() | Outputs one or more strings. | 4 |
13 | explode() | It is used to split a string by a specified character and form an array. | 4 |
14 | fprintf() | Used to write a formatted string to a stream | 5 |
15 | get_html_translation_table() | It returns the conversion table used by htmlspecialchars() and htmlentities() | 4 |
16 | hebrev() | Converts Hebrew (Hebrew) text to visible text. | 4 |
17 | hebrevc() | Converts Hebrew (Hebrew) text to visible text, and converts new lines (\n) to <br>. | 4 |
18 | hex2bin() | Used to convert hexadecimal strings to ASCII characters | 4 |
19 | html_entity_decode() | Used to convert HTML entities to characters. | 4 |
20 | htmlentities() | It is used to convert characters to HTML entities. | 5.4 |
21 | htmlspecialchars_decode() | Converts some predefined HTML entities to characters. | 5.1.0 |
22 | htmlspecialchars() | Converts some predefined characters to HTML entities. | 4 |
23 | implode() | It is used to concatenate array elements with a string | 5 |
24 | join() | It is an alias for implode(), which returns a string from the elements of an array | 4 |
25 | lcfirst() | It is used to convert the first character of a string to lowercase. | 5.3.0 |
26 | levenshtein() | Returns the Levenshtein distance between two strings. | 4.0.1 |
27 | localeconv() | Returns local number and currency format information. | 4 |
28 | ltrim() | It is used to remove spaces or other characters from the beginning of a string | 4 |
29 | md5_file() | Used to calculate the md of a given file5 Hashing | 4 |
30 | md5() | Used to calculate the md of a string5 Hashing | 4 |
31 | metaphone() | Calculates the metaphone key of a string. | 4 |
32 | money_format() | Used to format numbers into currency strings | 4.3.0 |
33 | nl_langinfo() | It contains information about the language and language environment | 4.3.0 |
34 | nl2br() | Inserts an HTML newline character before each new line in the string. | 4 |
35 | number_format() | Formats numbers by grouping in thousands. | 4 |
36 | ord() | Returns the ASCII value of the first character in the string. | 4 |
37 | parse_str() | It is used to parse a string into a variable | 4 |
38 | print() | Returns a string output | 4 |
39 | printf() | Returns a formatted string | 4 |
40 | mb_substr() | Cut a specified length of characters from a string, often used for Chinese truncation, which can avoid乱码when truncating, that is, truncating half a character. | 4 |
41 | quoted_printable_decode() | Used to convert a quoted printable string to8bit string | 4 |
42 | quoted_printable_encode() | Used to convert8Convert a bit string to a quoted printable string | 4 |
43 | quotemeta() | It is used to quote metacharacters | 4 |
44 | rtrim() | Remove whitespace characters or other characters from the right side of a string. | 4 |
45 | setlocale() | Used to set locale information | 4 |
46 | sha1_file() | Calculate the SHA of a file-1 Hashing. | 4 |
47 | sha1() | Calculate the SHA of a string-1 Hashing. | 4 |
48 | similar_text() | Used to calculate the similarity between two strings | 4 |
49 | soundex() | Calculate the soundex key of a string. | 4 |
50 | sprintf() | It is used to format a string | 4 |
51 | str_getcsv() | It is used to parse a CSV string into an array | 4 |
52 | str_ireplace() | Replace some characters in the string (case-insensitive). | 5 |
53 | str_pad() | It is used to pad a string to a new length. | 4.0.1 |
54 | str_repeat() | Used to repeat a string a specified number of times. | 4 |
55 | str_replace() | Replace some characters in the replacement string (case-insensitive). | 4 |
56 | str_rot13() | Execute ROT on a string.13 Encoding. | 4 |
57 | str_shuffle() | Randomly shuffle all characters in a string. | 4.3.0 |
58 | str_split() | Split a string into an array. | 5 |
59 | str_word_count() | Calculate the number of words in a string. | 5 |
60 | strcasecmp() | Used to compare two strings (case-insensitive). | 4 |
61 | strchr() | Find the first occurrence of a string in another string. (Alias of strstr()). | 4 |
62 | strcmp() | Compare two strings (case-insensitive). | 4 |
63 | strcoll() | Compare two strings (based on the local settings). | 4.0.5 |
64 | strcspn() | Returns the number of characters in the string before the first occurrence of any specified character. | 4 |
65 | strip_tags() | Remove HTML and PHP tags from a string. | 4 |
66 | stripcslashes() | Remove backslashes added by the addcslashes() function. | 4 |
67 | stripos() | Used to find the first occurrence of a string within another string. | 4 |
68 | stripslashes() | Remove backslashes added by the addslashes() function. | 4 |
69 | stristr() | Return the position of the first occurrence of a string in another string (case-insensitive). | 4 |
70 | strlen() | It is used to get the length of a string. | 4 |
71 | strnatcasecmp() | Compare two strings using a "natural sort" algorithm (case-insensitive). | 4 |
72 | strnatcmp() | Compare two strings using a "natural sort" algorithm (case-sensitive). | 4 |
73 | strncasecmp() | String comparison of the first n characters (case-insensitive). | 4 |
74 | strncmp() | String comparison of the first n characters (case-sensitive). | 4 |
75 | strpbrk() | Search for any specified character in a string. | 5 |
76 | strpos() | It is used to find the first occurrence of a string in another string (case-sensitive). | 4 |
77 | strrchr() | It is used to find the last occurrence of a character in a string. | 4 |
78 | strrev() | Used for reversing a string. | 4 |
79 | strripos() | Find the last occurrence of a string within another string (case-insensitive). | 5 |
80 | strspn() | Return the number of occurrences of a specific character in a string. | 4 |
81 | strstr() | Find the first occurrence of a string within another string (case-sensitive). | 4 |
82 | strtok() | Split a string into smaller strings. | 4 |
83 | strtolower() | Convert a string to lowercase letters. | 4 |
84 | strtoupper() | Convert a string to uppercase letters. | 4 |
85 | strtr() | Convert specific characters in a string. | 4 |
86 | substr_compare() | It is used to compare two string formats starting from a specific position | 4 |
87 | substr_count() | It is used to calculate the number of substrings | 4 |
88 | substr_replace() | Replace a part of the string with another string. | 4 |
89 | substr() | It is used to return a part of the string | 4 |
90 | trim() | Used to remove whitespace and other characters from both sides of a string. | 4 |
91 | ucfirst() | It is used to convert the first character of a string to uppercase | 4 |
92 | ucwords() | Convert the first letter of each word in a string to uppercase. | 4 |
93 | vfprintf() | Write the formatted string to the specified output stream. | 5 |
94 | vprintf() | Output a formatted string. | 4.1 |
95 | vsprintf() | It returns a formatted string | 4.1 |
96 | wordwrap() | Break the string into lines at specified length. | 4.0.2 |
97 | convert_uuencode() | Use uuencode to encode a string | 5 |