The PHP String function is an integral part of PHP core. No installation is required to use these functions.
function | describe |
---|---|
addcslashes() | Returns a string with a backslash preceding the specified character. |
addslashes() | Returns a string preceded by a backslash to a predefined character. |
bin2hex() | Converts a string of ASCII characters to a hexadecimal value. |
chop() | Removes whitespace or other characters from the right side of a string. |
chr() | Returns characters from the specified ASCII value. |
chunk_split() | Split a string into a series of smaller parts. |
convert_cyr_string() | Convert a string from one Cyrillic character set to another. |
convert_uudecode() | Decodes a uuencoded string. |
convert_uuencode() | Encode the string using the uuencode algorithm. |
count_chars() | Returns information about the characters used in a string. |
crc32() | Calculate the 32-bit CRC (cyclic redundancy check) of a string. |
crypt() | One-way string encryption (hashing). |
echo() | Output one or more strings. |
explode() | Break the string into an array. |
fprintf() | Writes a formatted string to the specified output stream. |
get_html_translation_table() | Returns the translation table used by htmlspecialchars() and htmlentities(). |
hebrev() | Convert Hebrew text to visible text. |
hebrevc() | Convert Hebrew text to visible text and newlines (n) to <br>. |
hex2bin() | Converts a string of hexadecimal values to ASCII characters. |
html_entity_decode() | Convert HTML entities to characters. |
htmlentities() | Convert characters to HTML entities. |
htmlspecialchars_decode() | Convert some predefined HTML entities into characters. |
htmlspecialchars() | Convert some predefined characters into HTML entities. |
implode() | Returns a string composed of array elements. |
join() | Alias for implode(). |
lcfirst() | Converts the first character in a string to lowercase. |
levenshtein() | Returns the Levenshtein distance between two strings. |
localeconv() | Returns local number and currency format information. |
ltrim() | Removes whitespace or other characters from the left side of a string. |
md5() | Computes the MD5 hash of a string. |
md5_file() | Calculate the MD5 hash of the file. |
metaphone() | Calculates the metaphone key of a string. |
money_format() | Returns a string formatted as a currency string. |
nl_langinfo() | Returns the specified local information. |
nl2br() | Inserts an HTML newline character before each new line in the string. |
number_format() | Format numbers by thousands grouping. |
ord() | Returns the ASCII value of the first character in a string. |
parse_str() | Parse the query string into variables. |
print() | Output one or more strings. |
printf() | Output a formatted string. |
quoted_printable_decode() | Convert a quoted-printable string to an 8-bit string. |
quoted_printable_encode() | Convert an 8-bit string to a quoted-printable string. |
quotemeta() | Quote metacharacters. |
rtrim() | Removes whitespace or other characters from the right side of a string. |
setlocale() | Set area information (regional information). |
sha1() | Computes the SHA-1 hash of a string. |
sha1_file() | Calculate the SHA-1 hash of the file. |
similar_text() | Calculate the similarity of two strings. |
soundex() | Calculate the soundex key of a string. |
sprintf() | Write the formatted string into a variable. |
sscanf() | Parses input from a string according to the specified format. |
str_getcsv() | Parse CSV string into array. |
str_ireplace() | Replace some characters in a string (case insensitive). |
str_pad() | Pad the string to the new length. |
str_repeat() | Repeat the string a specified number of times. |
str_replace() | Replace some characters in a string (case sensitive). |
str_rot13() | Perform ROT13 encoding on the string. |
str_shuffle() | Randomly shuffle all characters in a string. |
str_split() | Split the string into an array. |
str_word_count() | Count the number of words in a string. |
strcasecmp() | Compares two strings (case insensitive). |
strchr() | Finds the first occurrence of a string within another string. (Alias for strstr().) |
strcmp() | Compares two strings (case sensitive). |
strcoll() | Compares two strings (according to local settings). |
strcspn() | Returns the number of characters searched in a string before any specified character is found. |
strip_tags() | Strip HTML and PHP tags from strings. |
stripcslashes() | Remove backslashes added by the addcslashes() function. |
stripslashes() | Remove backslashes added by the addslashes() function. |
stripos() | Returns the position of the first occurrence of a string within another string (case insensitive). |
stristr() | Finds the first occurrence of a string within another string (case insensitive). |
strlen() | Returns the length of the string. |
strnatcasecmp() | Compares two strings using a "natural ordering" algorithm (case-insensitive). |
strnatcmp() | Compares two strings using a "natural ordering" algorithm (case sensitive). |
strncasecmp() | String comparison of first n characters (case insensitive). |
strncmp() | String comparison of first n characters (case sensitive). |
strpbrk() | Searches a string for any of the specified characters. |
strpos() | Returns the position of the first occurrence of a string within another string (case sensitive). |
strrchr() | Finds the last occurrence of a string within another string. |
strrev() | Reverse a string. |
strripos() | Finds the last occurrence of a string within another string (case insensitive). |
strrpos() | Finds the last occurrence of a string within another string (case sensitive). |
strspn() | Returns the number of specific characters contained in a string. |
strstr() | Finds the first occurrence of a string within another string (case sensitive). |
strtok() | Split the string into smaller strings. |
strtolower() | Convert a string to lowercase letters. |
strtoupper() | Convert a string to uppercase letters. |
strtr() | Convert specific characters in a string. |
substr() | Returns part of a string. |
substr_compare() | Compares two strings starting at a specified starting position (binary safe and optionally case-sensitive). |
substr_count() | Counts the number of times a substring appears in a string. |
substr_replace() | Replace part of a string with another string. |
trim() | Removes whitespace and other characters from both sides of a string. |
ucfirst() | Converts the first character in a string to uppercase. |
ucwords() | Converts the first character of each word in a string to uppercase. |
vfprintf() | Writes a formatted string to the specified output stream. |
vprintf() | Output a formatted string. |
vsprintf() | Write the formatted string into a variable. |
wordwrap() | Wraps the string according to the specified length. |