Str
class Str (View source)
Methods
upper case
lower case
camel
Snake case
Get str plurial
slice
split
Get the string position
Contains
replace
capitalize
Len
Wordify
Lists the string of characters in a specified number
Randomize
slugify slug creator using a simple chain.
unslugify, Lets you undo a slug
Check if the email is a valid email.
Check if the string is a domain
Check if the string is in alphanumeric
Check if the string is in numeric
Check if the string is in alpha
Check if the string is in slug format
Check if the string is in uppercase
Check if the string is lowercase
Returns the number of characters in a string.
Returns a determined number of words in a string.
Returns a string of words whose words are mixed.
Enables to force the encoding in utf-8
Enables to force the encoding in utf-8
__call
Details
static string
upper(string $str)
upper case
static string
lower(string $str)
lower case
static string
camel(string $str)
camel
static mixed
snake(string $str, string $delimiter = '_')
Snake case
static string
plurial(string $str)
Get str plurial
static string
slice(string $str, int $start, int|null $end = null)
slice
static array
split(string $pattern, string $str, string|null $limit = null)
split
static int
pos(string $search, string $string, int $offset = 0)
Get the string position
static bool
contains(string $search, string $str)
Contains
static string
replace(string $pattern, string $replaceBy, string $str)
replace
static string
capitalize(string $str)
capitalize
static int
len(string $str)
Len
static array
wordify(string $str, string $sep = ' ')
Wordify
static string
repeat(string $str, int $number)
Lists the string of characters in a specified number
static string
randomize(int $size = 16)
Randomize
static string
slugify(string $str, string $delimiter = '-')
slugify slug creator using a simple chain.
eg: 'I am a string of character' => 'i-am-a-chain-of-character'
static string
unSlugify(string $str)
unslugify, Lets you undo a slug
static bool
isMail(string $email)
Check if the email is a valid email.
eg: example@email.com => true
static bool
isDomain(string $domain)
Check if the string is a domain
eg: http://exemple.com => true eg: http:/exemple.com => false
static bool
isAlphaNum(string $str)
Check if the string is in alphanumeric
static bool
isNumeric(string $str)
Check if the string is in numeric
static bool
isAlpha(string $str)
Check if the string is in alpha
static bool
isSlug(string $str)
Check if the string is in slug format
static bool
isUpper(string $str)
Check if the string is in uppercase
static bool
isLower(string $str)
Check if the string is lowercase
static int
count(string $pattern, string $str)
Returns the number of characters in a string.
static string
getWords(string $words, int $len)
Returns a determined number of words in a string.
static string
shuffleWords(string $words)
Returns a string of words whose words are mixed.
static void
forceInUTF8()
Enables to force the encoding in utf-8
static string
fixUTF8(string $garbled_utf8_string)
Enables to force the encoding in utf-8
mixed
__call(string $method, array $arguments)
__call