PHP String
22 functions
strlenstrlen(string $string): intGet string length.
substrsubstr(string $string, int $offset, ?int $length): stringReturn part of a string.
strposstrpos(string $haystack, string $needle, int $offset = 0): int|falseFind the position of the first occurrence of a substring in a string.
str_containsstr_contains(string $haystack, string $needle): boolDetermine if a string contains a given substring. (PHP 8+)
str_starts_withstr_starts_with(string $haystack, string $needle): boolChecks if a string starts with a given substring. (PHP 8+)
str_ends_withstr_ends_with(string $haystack, string $needle): boolChecks if a string ends with a given substring. (PHP 8+)
str_replacestr_replace(array|string $search, array|string $replace, string $subject): stringReplace all occurrences of the search string with the replacement string.
strtolowerstrtolower(string $string): stringMake a string lowercase.
strtoupperstrtoupper(string $string): stringMake a string uppercase.
trimtrim(string $string, string $characters = ' \n\r\t\v\x00'): string앞뒤 공백(또는 지정 문자)을 제거합니다.
explodeexplode(string $separator, string $string, int $limit = PHP_INT_MAX): arraySplit a string by a string.
implodeimplode(string $separator, array $array): stringJoin array elements with a string.
sprintfsprintf(string $format, mixed ...$values): stringReturn a formatted string.
nl2brnl2br(string $string): stringInserts HTML line breaks before all newlines in a string.
htmlspecialcharshtmlspecialchars(string $string): stringConvert special characters to HTML entities.
strip_tagsstrip_tags(string $string): stringStrip HTML and PHP tags from a string.
str_padstr_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT): stringPad a string to a certain length with another string.
str_repeatstr_repeat(string $string, int $times): stringRepeat a string.
ucfirstucfirst(string $string): stringMake a string's first character uppercase.
ucwordsucwords(string $string): stringUppercase the first character of each word in a string.
str_splitstr_split(string $string, int $length = 1): arrayConvert a string to an array.
number_formatnumber_format(float $num, int $decimals = 0): stringFormat a number with grouped thousands.
