Download the PHP package romanlazko/str without Composer
On this page you can find all versions of the php package romanlazko/str. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package str
Str - PHP String Utilities
A comprehensive string manipulation library for PHP with multibyte support.
Installation
Usage
Using the Str Class
Using the str() Helper
Available Methods
String Case Conversion
camel(string $string): string- Convert to camelCasekebab(string $string): string- Convert to kebab-casesnake(string $string, string $delimiter = '_'): string- Convert to snake_casestudly(string $string): string- Convert to StudlyCasetitle(string $string): string- Convert to Title Caseucfirst(string $string): string- Make first character uppercaselcfirst(string $string): string- Make first character lowercaseupper(string $string): string- Convert to uppercaselower(string $string): string- Convert to lowercase
String Manipulation
length(string $string, ?string $encoding = 'UTF-8'): int- Get string lengthlimit(string $string, int $limit = 100, string $end = '...'): string- Limit string lengthwords(string $string, int $words = 100, string $end = '...'): string- Limit number of wordsreverse(string $string): string- Reverse the stringreplace(string $string, string|array $search, string|array $replace, int $count = null): string- Replace textrepeat(string $string, int $times): string- Repeat stringslug(string $string, string $separator = '-'): string- Generate URL-friendly slugsubstr(string $string, int $start, ?int $length = null, string $encoding = 'UTF-8'): string- Get substringsubstrCount(string $string, string $needle): int- Count substring occurrencessubstrReplace(string $string, string $replace, int $offset = 0, ?int $length = null): string- Replace text within portion of stringtrim(string $string, string $charlist = " \t\n\r\v\0"): string- Strip whitespace from beginning and endltrim(string $string, string $charlist = " \t\n\r\v\0"): string- Strip whitespace from beginningrtrim(string $string, string $charlist = " \t\n\r\v\0"): string- Strip whitespace from endstart(string $string, string $cap): string- Add string to start if not presentfinish(string $string, string $cap): string- Add string to end if not present
String Checks
contains(string $string, string $needle): bool- Check if string contains substringis(string $pattern, string $value): bool- Check if string matches patternstartsWith(string $string, string $needle): bool- Check if string starts with substringendsWith(string $string, string $needle): bool- Check if string ends with substringisAscii(string $string): bool- Check if string is ASCIIisUuid(string $string): bool- Check if string is a valid UUID
Helper Methods
str($string = null)- Create a chainable string instance
License
This package is open-source software licensed under the MIT license.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
All versions of str with dependencies
PHP Build Version
Package Version
The package romanlazko/str contains the following files
Loading the files please wait ...