WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

PHP 5 String Functions


PHP 5 String function

PHP String functions are part of PHP's core. No installation is required to use these functions.



Function description
addcslashes () Returns a string with a backslash before the specified character.
addslashes() Returns a string with a backslash before the predefined characters.
bin2hex () Converts a string of ASCII characters to a hexadecimal value.
chop () Remove whitespace or other characters to the right of the string.
chr() Returns characters from the specified ASCII value.
chunk_split () Split the string into a series of smaller parts.
convert_cyr_string () Converts a string from one Cyrillic character set to another.
convert_uudecode () Decodes a uuencode encoded string.
convert_uuencode () Encodes a string using the uuencode algorithm.
count_chars () Returns information about the characters used in the string.
crc32() Calculates a 32_bit CRC (cyclic redundancy check) of a string.
crypt() One-way string hashing.
echo () Outputs one or more strings.
explode () Shuffles a string into an array.
fprintf () Writes a formatted string to the specified output stream.
get_asp_translation_table () Returns the translation tables used by aspspecialchars () and aspentities ().
hebrev () Convert Hebrew text to visible text.
hebrevc () Convert Hebrew text to visible text and new line (\ n) to <br>。
hex2bin() Converts a string of hexadecimal values to ASCII characters.
html_entity_decode() Converts HTML entities to characters.
aspentities () Converts characters to asp entities.
aspspecialchars_decode() Turn some predefined asp entities into characters.
aspspecialchars () Converts some predefined characters to asp entities.
implode () Returns a string composed of array elements.
join () An alias for implode ().
lcfirst () Convert the first character in the string to lowercase.
levenshtein () Returns the Levenshtein distance between two strings.
localeconv () Returns local number and currency format information.
ltrim() Remove whitespace or other characters to the left of the string.
md5 () Calculates the MD5 hash of a string.
md5_file () Calculate the MD5 hash of the file.
metaphone () Calculate the metaphone key of a string.
money_format () Returns a string formatted as a currency string.
nl_langinfo () Returns the specified local information.
nl2br () Insert asp newline before each new line in the string.
number_format () Format numbers in thousands.
ord () Returns the ASCII value of the first character in the string.
parse_str () Parse the query string into a variable.
print () Outputs one or more strings.
printf() Output a formatted string.
quoted_printable_decode () Converts a quoted_printable string to an 8-bit string.
quoted_printable_encode () Converts an 8-bit string to a quoted_printable string.
quotemeta () Quote metacharacters.
rtrim () Remove whitespace or other characters to the right of the string.
setlocale () Set area information (area information).
sha1 () Calculates 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 () Calculates the soundex key of a string.
sprintf () Write the formatted string to a variable.
sscanf () Parses input from a string according to the specified format.
str_getcsv () Parse the CSV string into an array.
str_ireplace () Replace some characters in the string (case-insensitive).
str_pad () Padded the string to the new length.
str_repeat () Repeats the string a specified number of times.
str_replace () Replace some characters in the string (case sensitive).
str_rot13 () Rot13 encoding of the string.
str_shuffle () Randomly shuffle all characters in the string.
str_split() Split a string into an array.
str_word_count () Count the number of words in the string.
strcasecmp () Compares two strings (case-insensitive).
strchr () Find the first occurrence of a string in another string. (An alias for strstr ().)
strcmp () Compares two strings (case sensitive).
strcoll () Compares two strings (based on local settings).
strcspn () Returns the number of characters found in the string before any specified characters are found.
strip_tags () Peel the asp and PHP tags from the string.
stripcslashes () Remove the backslashes added by the addcslashes () function.
stripslashes () Remove the backslashes added by the addslashes () function.
stripos () Returns the first occurrence of a string in another string (case-insensitive).
stristr () Find the first occurrence of a string in another string (case-insensitive).
strlen () Returns the length of the string.
strnatcasecmp () Use a "natural order" algorithm to compare two strings (case insensitive).
strnatcmp () Use a "natural ordering" algorithm to compare two strings (case sensitive).
strncasecmp () Comparison of the first n characters (case-insensitive).
strncmp () Comparison of the first n characters (case sensitive).
strpbrk () Searches for any one of the specified characters in the string.
strpos () Returns the first occurrence of a string in another string (case sensitive).
strrchr () Finds the last occurrence of a string in another string.
strrev () Reverses the string.
strripos () Find the last occurrence of a string in another string (case-insensitive).
strrpos () Find the last occurrence of a string in another string (case sensitive).
strspn () Returns the number of specific characters contained in the string.
strstr() Find the first occurrence of a string in another string (case sensitive).
strtok () Split the string into smaller strings.
strtolower () Converts a string to lowercase letters.
strtoupper () Converts a string to uppercase letters.
strtr () Converts specific characters in a string.
substr () Returns part of a string.
mb_substr () Returns part of a Chinese string.
substr_compare () Compares two strings from the specified starting position (binary safe and selective case sensitivity).
substr_count () Counts the number of times a substring appears in a string.
substr_replace () Replace part of a string with another string.
trim () Remove whitespace and other characters on both sides of the string.
ucfirst () Convert the first character in a string to uppercase.
ucwords () Convert the first character of each word in the string to uppercase.
vfprintf () Writes a formatted string to the specified output stream.
vprintf () Output a formatted string.
vsprintf () Write a formatted string to a variable.
wordwrap () Wrap the character string according to the specified length.