XLVIII. String functions

These functions all manipulate strings in various ways. Some more specialized sections can be found in the regular expression and URL handling sections.

Table of Contents
AddSlashes — quote string with slashes
bin2hex — convert binary data into hexadecimal representation
Chop — remove trailing whitespace
Chr — return a specific character
chunk_split — Split a string into smaller chunks
convert_cyr_string — Convert from one Cyrillic character set to another
crypt — DES-encrypt a string
echo — output one or more strings
explode — split a string by string
flush — flush the output buffer
get_meta_tags — Extracts all meta tag content attributes from a file and returns an array
htmlspecialchars — Convert special characters to HTML entities.
htmlentities — Convert all applicable characters to HTML entities.
implode — join array elements with a string
join — join array elements with a string
ltrim — Strip whitespace from the beginning of a string.
md5 — calculate the md5 hash of a string
nl2br — Converts newlines to HTML line breaks.
Ord — return ASCII value of character
parse_str — parses the string into variables
print — output a string
printf — output a formatted string
quoted_printable_decode — Convert a quoted-printable string to an 8 bit string
QuoteMeta — quote meta characters
rawurldecode — decode URL-encoded strings
rawurlencode — URL-encode according to RFC1738
setlocale — set locale information
similar_text — calculate the similarity between two strings
soundex — calculate the soundex key of a string
sprintf — return a formatted string
strchr — Find the first occurrence of a character.
strcmp — binary safe string comparison
strcspn — find length of initial segment not matching mask
strip_tags — Strip HTML and PHP tags from a string
StripSlashes — un-quote string quoted with addslashes
strlen — get string length
strrpos — Find position of last occurrence of a char in a string.
strpos — Find position of first occurrence of a string.
strrchr — Find the last occurrence of a character in a string.
strrev — Reverse a string.
strspn — find length of initial segment matching mask
strstr — Find first occurrence of a string.
strtok — tokenize string
strtolower — Make a string lowercase.
strtoupper — Make a string uppercase.
str_replace — Replace all occurrences of needle in haystack with str
strtr — Translate certain characters.
substr — Return part of a string.
trim — Strip whitespace from the beginning and end of a string.
ucfirst — Make a string's first character uppercase
ucwords — Uppercase the first character of each word in a string