PHP String Functions - A Reference List

by Geethalakshmi 2012-06-30 14:02:20

PHP String Functions - A Reference List


• addcslashes ( ) - Adds backslashes to escape characters in a string
• addslashes ( ) - Escape Single Quotes
• bin2hex ( ) - Returns a hexadecimal representation of a string
• chop () - Trim specified characters from the end of string
• chr ( ) - Returns the character representation of an ASCII value
• chunk_split ( ) - Chunks a string at specified lengths and inserts value
• convert_cyr_string ( ) - Converts Cyrillic character sets
• convert_uudecode ( ) - Decode a previously uuencoded string
• convert_uuencode ( ) - Uuencode a string
• count_chars ( ) - Count character occurences of each byte value
• crc32 ( ) - Returns a binary sequence representing a string
• crypt ( ) - One way hash function that can use various system algorithms
• echo ( ) [ print ( ) ] - Output a string
• explode ( ) - Returns an array of substrings from a target string
• fprintf ( ) - Write formatted strings to file stream resources
• get_html_translation ( ) - Returns array of html encoding translations
• hebrev ( ) - Reverses the display of Hebrew characters
• hebrevc ( ) - Reverses the display of Hebrew with newline conversion
• html_entity_decode ( ) - Decodes HTML encoded strings
• htmlentities ( ) - Encodes all applicable HTML characters
• htmlspecialchars ( ) - Encodes special HTML characters
• htmlspecialchars_decode ( ) - Decodes encoded special HTML characters
• implode ( ) join ( ) - Both combine array elements into a string
• lcfirst ( ) - Make the first character lowercase in a string
• levenshtein ( ) - Calculate the Levenshtein distance between two strings
• Itrim ( ) - Removes characters and whitespace from the front of a string
• md5_file ( ) - Returns an MD5 hash of target file contents
• md5 ( ) - Returns the MD5 algorithm hash of a target string
• metaphone ( ) - Returns the metrophone key of a string
• money_ format ( ) - Convert a number to a currency string
• nl_langinfo ( ) - Query language and locale information
• nl2br ( ) - Add an HTML line break where new lines(\n) occur in a string
• number_format ( ) - Format numbers into grouped thousands
• ord ( ) - Returns the ASCII representation of a character
• parse_str ( ) - Parses a URL encoded string into variables
• print ( ) - String output similar to echo()
• printf ( ) - Returns a string that is converted by a supplied format
• stripos ( ) - Find the position of the first found substring occurrence
• stripslashes ( ) - Remove backslashes from a string
• rtrim ( ) - Trims a specified substring from the end of a string
• sha1 ( ) - Returns an encrypted sha1 hash from your target string
• sha1_file ( ) - Returns the sha1 hash of a target file
• similar_text ( ) - Check the similarity of two strings
• str_ireplace ( ) - Case insensitive search and replace function
• str_repeat ( ) - Repeat a string x amount of times
• str_replace ( ) - Case sensitive search and replace function
• str_shuffle ( ) - Randomly shuffle a string
• str_split ( ) - Splits a string into a chunked array
• str_word_count ( ) - Find the number of words in a string
• strcasecmp ( ) - Case insensitive string comparison function
• strcmp ( ) - Case sensitive string comparison function
• strip_tags ( ) - Removes HTML and PHP tags from a string
• stristr ( ) - Find the first occurrence of a substring in a string
• strlen ( ) - Returns the length of a string
• strrchr ( ) - Find the last occurrence of a substring in a string
• strrev ( ) - Reverse a string to render it backwards
• strtolower ( ) - Convert all capital letters to lowercase
• strtoupper ( ) - Convert all lowercase letters to capitals
• substr_count ( ) - Count the number of times a substring is found
• substr_replace ( ) - Replace a specified portion of a string
• substr ( ) - Return a specified portion of a string
• trim ( ) - Remove whitespace(or chars) from both ends of a string
• ucfirst ( ) - Capitalize the first letter of a string
• ucwords ( ) - Capitalize the first letter of each word in a string
• wordwrap ( ) - force line break in a string at a length that you specify
1696
like
0
dislike
0
mail
flag

You must LOGIN to add comments