Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 1.45 KB

File metadata and controls

61 lines (41 loc) · 1.45 KB

String functions

  • Convert special characters to HTML entities
htmlspecialchars_recursive(mixed $args): mixed
  • Add a string before or after
wrap_implode(array $array, string $before = '', string $after = '', string $separator = ''): string
  • implode an array as key-value pairs
mapped_implode(string $glue, array $array, string $symbol = '='): string
  • Join pieces with a string recursively
implode_recursive(iterable|string $separator, iterable $pieces = null): string
  • Find the position of the first occurrence of a substring in a string
strpos_recursive(string $haystack, string $needle, int $offset = 0, array $results = []): string|array
  • Get a string before the first occurence of the substring. If the substring is not found, the whole string is returned.
str_before(string $string, string $substr): string
  • Get a string after the first occurence of the substring. If the substring is not found, an empty string is returned.
str_after(string $string, string $substr): string
  • Replace characters with accents with normal characters.
str_remove_accents(string $string): string
  • Generate a URL friendly slug from the given string.
str_slug(string $string, string $glue = '-'): string
  • Truncate String (shorten) with or without ellipsis.
str_shorten(string $string, int $maxLength, bool $addEllipsis = true, bool $wordsafe = false): string