contains(string $haystack, string $needle): bool |
If haystack contains needle. |
icontains(string $haystack, string $needle): bool |
If haystack contains needle ignoring case. |
startsWith(string $haystack, string $needle): bool |
If haystack starts with needle. |
istartsWith(string $haystack, string $needle): bool |
If haystack starts with needle ignoring case. |
endsWith(string $haystack, string $needle): bool |
If haystack ends with needle. |
iendsWith(string $haystack, string $needle): bool |
If haystack ends with needle ignoring case. |
indexOfAll(string $haystack, string $needle): array |
Get the position of all occurrences of needle in haystack. |
indexOf(string $haystack, string $needle, int $offset = 0): int |
Get the position of the first occurrence of needle in haystack. |
indexOfLast(string $haystack, string $needle, int $offset = 0): int |
Get the position of the last occurrence of needle in haystack. |
replaceArray(array $replace, string $string) |
Replace multiple occurencies of a string with another using key-value-pairs. |
ensureStart(string $string, string $prefix): string |
Ensures that the string starts with prefix. |
ensureEnd(string $string, string $suffix): string |
Ensures that the string ends with suffix. |
before(string $haystack, string $needle): string |
Returns the part of haystack before the first occurrence of needle. |
after(string $haystack, string $needle): string |
Returns the part of haystack after the first occurrence of needle. |
beforeLast(string $haystack, string $needle): string |
Returns the part of haystack before the last occurrence of needle. |
afterLast(string $haystack, string $needle): string |
Returns the part of haystack after the last occurrence of needle. |
snakeToCamelCase(string $string): string |
Converts a snake_case string to camelCase . |
kebabToCamelCase(string $string): string |
Converts a kebab-case string to camelCase . |
pascalToCamelCase(string $string): string |
Converts a PascalCase string to camelCase . |
camelToSnakeCase(string $string): string |
Converts a camelCase string to snake_case . |
kebabToSnakeCase(string $string): string |
Converts a kebab-case string to snake_case . |
pascalToSnakeCase(string $string): string |
Converts a PascalCase string to snake_case . |
snakeToKebabCase(string $string): string |
Converts a snake-case string to kebab-case . |
camelToKebabCase(string $string): string |
Converts a camelCase string to kebab-case . |
pascalToKebabCase(string $string): string |
Converts a PascalCase string to kebab-case . |
camelToPascalCase(string $string): string |
Converts a camelCase string to PascalCase . |
snakeToPascalCase(string $string): string |
Converts a snake_case string to PascalCase . |
toOsSeperator(string $path) |
Changes / and \ to the os seperator. |
stripNamespaceFromClassName(string $class) |
Strips the class name from a namespace to just return the class name. |
removeLineBreaks(string $string, string $replaceWith = '') |
Removes line breaks (\n , \r ) from a string. |
removeLineControls(string $string, string $replaceWith = '') |
Removes line breaks (\n , \r , \t ) from a string. |
removeHtmlComments(string $string, string $replaceWith = '') |
Removes html comments (<!-- --> ) from a string. |
zeroFill(string $string, int $length) |
Zero fills a number to reach the passed length. |
breakToNewLine(string $string, bool $multiByte = true) |
Does the opposite of nl2br by replacing breaks (<br> ) with new lines (\n ). |
isAscii(string $string) |
Whether a string is ASCII. |
isUtf8(string $string) |
Whether a string is UTF-8. |
encodeUtf8(string $string, ?string $fromEncoding = null): ?string |
Encodes a string to UTF-8. |
decodeUtf8(string $string, string $toEncoding = 'ISO-8859-1'): ?string |
Decodes a UTF-8 string. |
jsonValidate(string $json, int $depth = 512, int $flags = 0) |
If a string is a valid json representation. |
parseUrl(string $url): array |
Parses a url to an array of parts. |
unparseUrl(array $parsedUrl): string |
Unparses a url array back to a string. |
parseCsv(string $csvString, string $delimiter = ',', bool $skipEmptyLines = true, bool $trimFields = true): array |
Parses a csv string to an array. |
multiByteReplace(string $needle, string $replacement, string $haystack) |
Replaces needle in multi-byte haystack with replacement string. |
multiByteTrim(string $string, ?string $characterMask = null) |
Trims a multi-byte string by removing whitespaces etc. |
multiBytePad(string $string, int $length, string $padString = ' ', int $padType = \STR_PAD_RIGHT, string $encoding = null) |
Pad a multi-byte string to a certain length with another string. |
multiByteReverse(string $string): string |
Reverses the order of the characters of a multi-byte string. |
multiByteSplit(string $string, int $length = 1, ?string $encoding = null): array |
Splits a multi-byte string. |
multiByteParseUrl(string $url): array |
Parses a multi-byte url string to an array of parts. |