Advertisement

PHP 5 String Functions

PHP 5 String Functions

PHP string functions are part of the PHP core. No installation needed to use these functions.

function description
addcslashes () Back in front of the specified character string to add the backslash.
addslashes () Back before the predefined character string to add the backslash.
bin2hex () To convert a string of ASCII characters to hexadecimal values.
chop () Remove the string to the right of whitespace or other characters.
chr () Returns the value of the character from the specified ASCII.
chunk_split () The string is divided into a series of smaller parts.
convert_cyr_string () String from one Cyrillic character set to another.
convert_uudecode () Decode uuencode encoded string.
convert_uuencode () Using the uuencode algorithm to encode strings.
count_chars () Returns information about characters used in a string of information.
crc32 () 32-bit CRC calculation string.
crypt () One-way string encryption (hashing).
echo () Output one or more strings.
explode () Break up the string array.
fprintf () The format string is written to the specified output stream.
get_html_translation_table () Returns the translation table by the htmlspecialchars () and htmlentities () uses.
hebrev () The Hebrew text is converted to visible text.
hebrevc () The Hebrew text is converted to visible text, and the new line (\ n) is converted to <br>.
hex2bin () To convert a string of hexadecimal values ​​to ASCII characters.
html_entity_decode () The HTML entities to characters.
htmlentities () To convert characters to HTML entities.
htmlspecialchars_decode () Some predefined HTML entities to characters.
htmlspecialchars () Some predefined characters into HTML entities.
implode () Returns a combination of array elements into a string.
join () implode () alias.
lcfirst () The first character of the string converted to lowercase.
levenshtein () Back Levenshtein distance between two strings.
localeconv () Returns the local number, and currency formatting information.
ltrim () Remove the left side of a string of blank characters or other characters.
md5 () Calculate the MD5 hash of the string.
md5_file () MD5 hash calculation of files.
metaphone () Calculation metaphone key string.
money_format () Returns a string formatted as a currency string.
nl_langinfo () Returns specific local information.
nl2br () Before the string for each new row into HTML line breaks.
number_format () Thousands of groups to digital format.
ord () It returns the ASCII value of the first string of characters.
parse_str () To resolve the query string variable.
print () Output one or more strings.
printf () Formatted string output.
quoted_printable_decode () Convert quoted-printable string to an 8 string.
quoted_printable_encode () Converting 8 string to a quoted-printable string.
quotemeta () Quote metacharacters.
rtrim () Remove the right side of a string of blank characters or other characters.
setlocale () Setting Area information (geographic information).
sha1 () Calculation of the string SHA-1 hash.
sha1_file () Computing the SHA-1 hash files.
similar_text () Compute the similarity of two strings.
soundex () Calculate soundex key of a string.
sprintf () Writes the formatted string variable.
sscanf () Parsing input from a string according to the specified format.
str_getcsv () CSV to parse the string array.
str_ireplace () Some characters in the replacement string (case insensitive).
str_pad () String filled with the new length.
str_repeat () The string specified number of iterations.
str_replace () Some characters in the replacement string (case-sensitive).
str_rot13 () Perform ROT13 encoding strings.
str_shuffle () Randomly disrupt all the characters in a string.
str_split () String into array.
str_word_count () Calculate the number of words in a string.
strcasecmp () Compares two strings (case insensitive).
strchr () Find a string in another string of the first occurrence. (Strstr () alias.)
strcmp () Compares two strings (case sensitive).
strcoll () Compares two strings (according to local settings).
strcspn () Back before finding any part of some specified character, find the number of characters in a string.
strip_tags () Stripped string HTML and PHP tags.
stripcslashes () Deleted by addcslashes function to add backslash ().
stripslashes () Remove from the addslashes function to add the backslash ().
stripos () Returns the string in another string of the first occurrence (not case sensitive).
stristr () Find the string in another string of the first occurrence (not case sensitive).
strlen () Returns the length of the string.
strnatcasecmp () Using a "natural order" algorithm to compare two strings (case insensitive).
strnatcmp () Using a "natural order" algorithm to compare two strings (case sensitive).
strncasecmp () String comparison of the first n characters (not case sensitive).
strncmp () String comparison of the first n characters (case sensitive).
strpbrk () Find any character a set of characters in a string.
strpos () Returns the string in another string of the first occurrence (case-sensitive).
strrchr () Find string within another string of the last occurrence.
strrev () Reverse string.
strripos () Find the string in another string of the last occurrence (not case sensitive).
strrpos () Find the string in another string of the last occurrence (case-sensitive).
strspn () Returns the number of strings contained specific characters.
strstr () Find a string in another string of the first occurrence (case sensitive).
strtok () String into smaller strings.
strtolower () Converts a string to lowercase.
strtoupper () Converts a string to uppercase.
strtr () Conversion specific character string.
substr () Returns part of a string.
substr_compare () Compare two strings from the specified start position (binary safe and selective case-sensitive).
substr_count () The number of occurrences in the string substring computing.
substr_replace () Replace part of a string with another string.
trim () Remove blank character string sides and other characters.
ucfirst () The first character in the string converted to uppercase.
ucwords () The first character of each word in a string to uppercase.
vfprintf () The format string is written to the specified output stream.
vprintf () Formatted string output.
vsprintf () Writes a formatted string to a variable.
wordwrap () Break a string to a specified number of strings