sprite 1 sprite 30
functions-online

String

Execute and test PHP functions for string manipulation.

addslashes

Returns a string with backslashes before characters that need to be quoted in database queries etc.

bin2hex

Returns an ASCII string containing the hexadecimal representation of $str. The conversion is done byte-wise with the high-nibble first.

chr

Returns a one-character string containing the character specified by $ascii.

chunk_split

chunk_split() inserts $end every $chunklen characters in $body.

count_chars

Counts the number of occurrences of every byte-value (0..255) in $string and returns it in various ways.

explode

Returns an array of strings, each of which is a substring of $string formed by splitting it on boundaries formed by the string $delimiter.

html_entity_decode

html_entity_decode() is the opposite of htmlentities() in that it converts all HTML entities to their applicable characters from $string.

htmlentities

This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.

htmlspecialchars

Certain characters have special significance in HTML, and should be represented by HTML entities if they are to preserve their meanings.

implode

Join array elements with a string.

levenshtein

The Levenshtein distance is defined as the minimal number of characters you have to replace, insert or delete to transform $str1 into $str2.

ord

Returns the ASCII value of the first character of string.

parse_str

Parses $str as if it were the query string passed via a URL and sets variables in the current scope.

similar_text

similar_text calculate the similarity between two strings.

str_pad

This functions returns the $input string padded on the left, the right, or both sides to the specified padding length.

str_replace

This function returns a string or an array with all occurrences of $search in $subject replaced with the given $replace value.

str_rot13

str_rot13() performs the ROT13 encoding on the $str argument and returns the resulting string.

stripos

Returns the numeric position of the first occurrence of $needle in the $haystack string.

stristr

Returns all of $haystack from the first occurrence of $needle to the end. The search is not case sensitive.

strlen

The function strlen() returns the length of the given $string.

strncmp

This function is similar to strcmp(), with the difference that you can specify the (upper limit of the) number of characters from each string to be used in the comparison.

strpos

Returns the numeric position of the first occurrence of $needle in the $haystack string.

strripos

Find position of last occurrence of $needle in the case-insensitive string $haystack.

strrpos

Returns the numeric position of the last occurrence of $needle in the $haystack string.

strstr

Returns part of $haystack string from the first occurrence of $needle to the end of $haystack.

strtolower

Returns $str with all alphabetic characters converted to lowercase.

strtoupper

Returns $str with all alphabetic characters converted to uppercase.

strtr

This function returns a copy of $str, translating all occurrences of each character in $from to the corresponding character in $to.

substr

Returns the portion of string specified by the $start and $length parameters.

substr_count

substr_count() returns the number of times the $needle substring occurs in the $haystack string.

trim

This function returns a string with whitespace stripped from the beginning and end of $str.

ucfirst

Returns a string with the first character of $str capitalized, if that character is alphabetic.

ucwords

Returns a string with the first character of each word in $str capitalized, if that character is alphabetic.

wordwrap

Wraps a string to a given number of characters using a string break character.