The built-in PHP string functions allows you to access and manipulate strings.
Installation
List of String Functions
Sr.No | Function & Description | PHP |
---|---|---|
1 | addcslashes It returns the string with blackslashes | 4 |
2 | addslashes It returns the string with blackslashes in front of predefined characters | 4 |
3 | bin2hex It is used to convert primary data to hexadecimal representation | 4 |
4 | chop It is used to removes whitespace | 4 |
5 | chr It returns the specific characters | 4 |
6 | chunk split It is used to split a string into chunks. | 5 |
7 | convert cyr string It is used to convert from one Cyrillic character set to another | 4 |
8 | convert uudecode It is used to decode a encoded string | 5 |
9 | count chars It is used to returns the information about character used in a string | 4 |
10 | Crc32 It is used to calculates 32-bit CRC | 4 |
11 | crypt It is used to hashing the string | 4 |
12 | Echo It is give the output as one or more string | 4 |
13 | explode It is used to split a string by string | 4 |
14 | fprintf It is used to write a formatted string to a stream | 5 |
15 | get html translation table It returns the translation table used by htmlspecialchars() and htmlentities() | 4 |
16 | hebrev It is used to convert logical Hebrew text to visual text | 4 |
17 | Hebrevc It is used to convert logical Hebrew text to visual text with newline conversion | 4 |
18 | hex2bin It is used to convert a string of hexadecimal to ASCII character | 4 |
19 | html entity decode It is used to convert HTML entities to their application characters | 4 |
20 | htmlentities It is used to convert all applicable characters to Html entities | 5.4 |
21 | html special chars decode It is used to convert convert special HTML entities back to characters. | 5.1.0 |
22 | htmlspecialchars It is used to convert special characters to HTML entities | 4 |
23 | implode It is used to Join array elements with a string. | 5 |
24 | join It is alias of implode(), it returns string from the elements of an array | 4 |
25 | lcfirst It is used to make a string's first character should be lowercase. | 5.3.0 |
26 | levenshtein It is used calculate Levenshtein distance between two strings | 4.0.1 |
27 | localeconv It is used to get numeric formatting information | 4 |
28 | ltrim It used to strip whitespace or other characters from the beginning of a string | 4 |
29 | md5_file It is used to calculates the md5 hash of a given file | 4 |
30 | md5 It is used to calculates the md5 hash of a string | 4 |
31 | metaphone It is used to calculates the metaphone key of a string | 4 |
32 | money format It is used to formats a number as a currency string | 4.3.0 |
33 | nl langinfo It has contained information about language and locale | 4.3.0 |
34 | nl2br It Inserts HTML line breaks before all newlines in a string | 4 |
35 | number format It is used to formats a number with grouped thousands | 4 |
36 | ord It returns ASCII Value of character | 4 |
37 | parse str It is used to parses the string into variables | 4 |
38 | print It returns output a string | 4 |
39 | printf It returns output a formatted string | 4 |
40 | quoted printable decode It is used to convert the quoted printable string to 8 bit string | 4 |
41 | quoted printable decode It is used to convert the quoted printable string to 8 bit string | 4 |
42 | quoted printable encode It is used to convert 8 bit string to the quoted printable string | 4 |
43 | quotemeta It is used to quote meta characters | 4 |
44 | rtrim It is used to remove the white spaces from end of the string | 4 |
45 | setlocale It is used to set locale information | 4 |
46 | sha1 file It is used to calculate the sha1 hash of a file | 4 |
47 | sha1 It is used to calculate the sha1 hash of a string | 4 |
48 | similar text It is used to calculate the similarity between two strings | 4 |
49 | soundex It is used to calculate the soundex key of string | 4 |
50 | sprintf It is used to a formatted string | 4 |
51 | str getcsv It is used to parse parse a CSV string into array | 4 |
52 | str ireplace It is used to replace the characters with some other characters | 5 |
53 | str pad It is used to pads a string to a new length. | 4.0.1 |
54 | str repeat It is used to repeat a string | 4 |
55 | str replace It is used to replace the string with another string | 4 |
56 | str rot13 It is used to perform the rot13 transform on a string | 4 |
57 | str shuffle It is used to randomly shuffles a string | 4.3.0 |
58 | str split It is used to convert a string to an array | 5 |
59 | str word count It returns information about words used in a string | 5 |
60 | strcasecmp It is used to compare two strings | 4 |
61 | strchr It is used to searches for the first occurrence of a string inside another | 4 |
62 | strcmp It is used to compare two strings | 4 |
63 | strcoll It is used to compare two strings based on locale | 4.0.5 |
64 | strcspn It returns number of characters find in a string before any part of the specified characters are found. | 4 |
65 | strip tags It is used to string HTML and PHP tags from a string. | 4 |
66 | stripcslashes It is used to removes backslashes | 4 |
67 | stripos It is used to find the position of first occurrence of a string inside the another string | 4 |
68 | stripslashes It is used to un-quoted a quoted string | 4 |
69 | stristr It is used searches for the first occurrence of a string inside another string. | 4 |
70 | strlen It is used get string length. | 4 |
71 | strnatcasecmp It is used compare two strings with a natural algorithm. | 4 |
72 | strnatcmp It is used compare two strings with a natural order algorithm. | 4 |
73 | strncasecmp It is used compare two strings. | 4 |
74 | strncmp It is used compare first n character. | 4 |
75 | strpbrk It is used search's a string for a specific character. | 5 |
76 | strpos It is used to find the position of first occurrence of a string inside another string. | 4 |
77 | strrchr It is used to find the last occurrence of a character in a string. | 4 |
78 | strrev It is used to reverse a string. | 4 |
79 | strripos It is used find the position of the last occurrence of a string inside the another string | 5 |
80 | strspn It returns number of characters found in the string from the charlist parameter. | 4 |
81 | strstr It is used to find the first occurrence of a string | 4 |
82 | strtok It is a tokenize string | 4 |
83 | strtolower It used to make a string lower case | 4 |
84 | strtoupper It used to make a string upper case | 4 |
85 | strtr It used to translates character or replace substring | 4 |
86 | substr_compare It used to compare two string format with a specific start position | 4 |
87 | substr_count It used to count the number of sub strings | 4 |
88 | substr_replace It used to replace the part of string with another string | 4 |
89 | substr It used to return a part of a string | 4 |
90 | trim It used to remove the whitespaces and other characters | 4 |
91 | ucfirst It used to convert the first character of a string to upper case | 4 |
92 | ucwords It used to convert the first character of a string to upper case in each string | 4 |
93 | vfprintf It used to convert formatted string to specific output | 5 |
94 | vprintf It used to convert string to formatted string | 4.1 |
95 | vsprintf It returns the formatted string | 4.1 |
96 | wordwrap It used to convert the long words to be broken and its arrange to the next line | 4.0.2 |
Do feel free to ask your questions where necessary and we will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.
Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.
Thanks for reading and bye for now.