PHP String functions
A
The PHP addcslashes() function returns a string with backslashes before the characters that are listed in the characters parameter.
The PHP addslashes() function returns a string with backslashes before characters that need to be escaped.
E
The PHP explode() function splits a string into an array using a specified delimiter.
H
The PHP htmlentities() function converts all applicable characters to HTML entities.
The PHP htmlspecialchars() function converts special characters to HTML entities.
I
The PHP implode() function joins array elements into a string using a specified separator.
L
The PHP lcfirst() function makes the first character of a string lowercase.
The PHP ltrim() function removes whitespace or specified characters from the beginning of a string.
N
The PHP nl2br() function inserts HTML line breaks before all newlines in a string.
R
The PHP rtrim() function removes whitespace or specified characters from the end of a string.
S
The PHP str_contains() function checks if a string contains a given substring.
The PHP str_ends_with() function checks if a string ends with a given substring.
The PHP str_replace() function replaces all occurrences of a search string with a replacement string.
The PHP str_starts_with() function checks if a string starts with a given substring.
The PHP strcmp() function compares two strings in a case-sensitive manner.
The PHP strip_tags() function removes HTML and PHP tags from a string.
The PHP strlen() function returns the length of a string.
The PHP strncmp() function compares the first N characters of two strings.
The PHP strpos() function is used to find the position of the first occurrence of a substring within a string.
The PHP strrpos() function finds the position of the last occurrence of a substring within a string.
The PHP strtolower() function converts a string to lowercase.
The PHP strtoupper() function converts a string to uppercase.
The PHP substr() function returns a portion of a string.
T
The PHP trim() function removes whitespace (or other predefined characters) from the beginning and end of a string.
U
The PHP ucfirst() function makes the first character of a string uppercase.
The PHP ucwords() function capitalizes the first character of each word in a string.
W
The PHP wordwrap() function wraps a string to a given number of characters.