Download the PHP package arpadhegedus/utility without Composer
On this page you can find all versions of the php package arpadhegedus/utility. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download arpadhegedus/utility
More information about arpadhegedus/utility
Files in arpadhegedus/utility
Package utility
Short Description Utility classes for everyday php development
License MIT
Informations about the package utility
Utility
Table of Contents
- Arr
- get
- group
- keys
- remove
- set
- sort
- sortKeys
- values
- abides
- abidesAny
- add
- dd
- dump
- merge
- getShallowType
- append
- average
- blueprint
- clean
- contains
- containsAll
- containsAny
- divide
- dot
- each
- filter
- find
- findAll
- first
- flatten
- has
- hasAll
- hasAny
- implode
- initial
- intersection
- intersects
- isAssoc
- isNumeric
- isSequential
- last
- map
- mapRecursive
- matches
- matchesAny
- max
- min
- normalize
- prepend
- pluck
- random
- range
- reject
- removeFirst
- removeLast
- removeValue
- repeat
- replace
- rest
- reverse
- search
- size
- undot
- unique
- without
- Chain
- __construct
- break
- swap
- __call
- start
- Collection
- abides
- abidesAny
- add
- dd
- dump
- merge
- getShallowType
- get
- group
- keys
- remove
- set
- sort
- sortKeys
- values
- Func
- cache
- call
- once
- only
- throttle
- Geo
- address
- addressDistance
- distance
- getAddress
- getDistance
- Misc
- abides
- abidesAny
- add
- dd
- dump
- merge
- getShallowType
- Num
- abides
- abidesAny
- add
- dd
- dump
- merge
- getShallowType
- accord
- fileSize
- format
- isBetween
- isEven
- isNegative
- isOdd
- isOutside
- isPositive
- limit
- max
- min
- ordinal
- pad
- percentOf
- Obj
- get
- group
- keys
- remove
- set
- sort
- sortKeys
- values
- abides
- abidesAny
- add
- dd
- dump
- merge
- getShallowType
- has
- properties
- methods
- unpack
- Str
- abides
- abidesAny
- add
- dd
- dump
- merge
- getShallowType
- accord
- alpha
- alphaNumeric
- append
- ascii
- at
- base64
- between
- bool
- camel
- chars
- clean
- collapse
- common
- commonPrefix
- commonSuffix
- contains
- containsAll
- containsAny
- count
- dashed
- delimit
- endsWith
- endsWithAny
- ensureLeft
- ensureRight
- fileSize
- first
- htmlDecode
- htmlEncode
- index
- indexes
- insert
- isAlpha
- isAlphanumeric
- isBase64
- isBlank
- isEmail
- isHexadecimal
- isHTML
- isIP
- isJSON
- isLower
- isRegex
- isSerialized
- isUpper
- isURL
- last
- lastIndex
- length
- limit
- limitWords
- lines
- lower
- lowerFirst
- matches
- normalize
- ordinal
- pad
- padBoth
- padLeft
- padRight
- pascal
- prepend
- random
- regexReplace
- remove
- removeLeft
- removeRight
- repeat
- replace
- reverse
- shuffle
- slice
- slug
- slugify
- snake
- spacesToTabs
- split
- startsWith
- startsWithAny
- stringReplace
- stripWhitespace
- sub
- tabsToSpaces
- template
- timesContains
- title
- titlize
- trim
- trimLeft
- trimRight
- underscored
- upper
- upperFirst
- words
- URL
- auth
- build
- current
- fragment
- fragmentSet
- host
- hostSet
- parse
- parts
- pass
- path
- pathRemove
- pathSet
- port
- portSet
- query
- queryAdd
- queryArray
- queryGet
- queryRemove
- querySet
- scheme
- schemeSet
- user
Arr
- Full name: \Utility\Arr
- Parent class: \Utility\Collection
get
Get a value of a $collection by a $key of $separator notation with $default fallback
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$key |
string | |
$default |
mixed | |
$separator |
string |
group
Group values from a $collection according to the results of a $callback
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$callback |
callable |
keys
Get keys from a $collection
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object |
remove
Remove a $key value in a $collection using $separator notation.
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$key |
string|array | |
$separator |
string |
set
Set a $value in a $collection using $separator notation.
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$key |
string | |
$value |
mixed | |
$separator |
string |
sort
Sort a $collection by value, by a closure or by a property $sorter along a $direction
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$direction |
string | |
$sorter |
null|callable|string |
sortKeys
Sort a $collection by keys or properties by $direction
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$direction |
string |
values
Get values from a $collection
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object |
abides
Check if $data abides an array of $rules
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$rules |
array|callable |
abidesAny
Check if $data abides any of an array of $rules
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$rules |
string|array|callable |
add
Add mixed $data to other mixed data cleverly
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
dd
Dump $data and die
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
dump
Dry dump $data for debug
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
merge
Merge mixed $data to other mixed data cleverly
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
getShallowType
Get a simplified type of a variable.
Return values: string|array|object|number|boolean|unknown
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
append
Append a $value to an $array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$value |
mixed |
average
Get average value of an $array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$decimals |
integer |
blueprint
Build an $array from a $ruleset blueprint and fallback $defaults
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$ruleset |
array | |
$defaults |
array |
clean
Clean all falsy values from an array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$normalize |
boolean |
contains
Check if a $value is in an $array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$value |
mixed |
containsAll
Check if $array contains all $values
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$values |
array |
containsAny
Check if $array contains any of the $values
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$values |
array |
divide
Divide an $array into to arrays, the first containing the keys, the second the values
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array |
dot
Flatten a multidimensional $array with $separator notation
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$separator |
string | |
$parent |
null|string |
each
Iterate over an $array and modify the array's values via $callback function
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$callback |
callable | |
$passKey |
boolean |
filter
Find all items in an $array that pass a $callback truth test
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$callback |
callable | |
$pass |
string|integer | |
$normalize |
boolean |
find
Find the first item in an $array that passes $callback the truth test
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$callback |
callable | |
$passKey |
boolean |
findAll
Find all items in an $array that passes $callback truth test
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$callback |
callable | |
$passKey |
boolean |
first
Get the first $number of values from an $array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$number |
integer |
flatten
Flatten a multi-dimensional $array into a one-dimenisional array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$preserveKeys |
boolean |
has
Check if an $array has a $key
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$key |
integer|string |
hasAll
Check if an $array has all $keys
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$keys |
array |
hasAny
Check if an $array has any of the $keys
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$keys |
array |
implode
Implode an $array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$glue |
string |
initial
Get everything from $array but the last $number of items
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$number |
integer |
intersection
Return an array with all elements found in both $a and $b input arrays
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$a |
array | |
$b |
array |
intersects
Return if $a and $b input arrays intersect or not
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$a |
array | |
$b |
array |
isAssoc
Check if an $array is associative
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array |
isNumeric
Check if an $array only has numeric keys
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array |
isSequential
Check if $array is a numeric sequential array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array |
last
Get the last $number of values from an $array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$number |
integer |
map
Invoke a $callback function on all of the values in an $array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$callback |
callable | |
$arguments |
array |
mapRecursive
Invoke a $vallbackfunction on all of the values in an $array recursively
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$callback |
callable |
matches
Check if all items in an $array match a $callback truth test
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$callback |
callable |
matchesAny
Check if any item in an $array matches a $callback truth test
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$callback |
callable |
max
Get the max value of an $array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$callback |
null|callable |
min
Get the min value of an $array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$callback |
null|callable |
normalize
Normalize $array by sorting and filling missing keys
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array |
prepend
Prepend an $array with a $value
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$value |
mixed |
pluck
Get the value per $key from an $array of associative arrays
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$key |
mixed | |
$preserveKeys |
boolean | |
$keepEmpty |
boolean |
random
Get a $number of random values from an $array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$number |
integer |
range
Generate an array from a range starting from $base to $stop by $step
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$base |
integer | |
$stop |
integer | |
$step |
integer |
reject
Return all items from an $array that fail the $callback truth test
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$callback |
callable | |
$passKey |
boolean | |
$normalize |
boolean |
removeFirst
Remove the first item from an $array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array |
removeLast
Remove the last item from an array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array |
removeValue
Remove a $value from an $array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$value |
mixed | |
$normalize |
boolean |
repeat
Fill an array with some $data a number of $times
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$times |
integer |
replace
Replace each $search word or pattern with $replacement inside $array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$search |
string | |
$replacement |
string |
rest
Get the last $number of items of an $array.
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$number |
integer |
reverse
Reverse an $array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array |
search
Search for the index of a value in an array.
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$value |
mixed |
size
Get the size of an array.
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array |
undot
Unflatten a previously flattened $array using $separator notation
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$separator |
string |
unique
Remove duplicates from an array.
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array |
without
Return an array without all instances of certain values.
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array | |
$values |
mixed |
Chain
- Full name: \Utility\Chain
__construct
Start a new chain
Parameters:
Parameter | Type | Description |
---|---|---|
$subject |
mixed | |
$class |
string|object |
break
Break the chain and return subject
swap
Swap Utility class along the chain
Parameters:
Parameter | Type | Description |
---|---|---|
$class |
string|object |
__call
Dispatch method calls to Utility class and pass in subject as the first argument
Parameters:
Parameter | Type | Description |
---|---|---|
$method |
string | |
$arguments |
array |
start
Start a new chain
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$subject |
mixed | |
$class |
string|object |
Collection
- Full name: \Utility\Collection
- Parent class: \Utility\Misc
abides
Check if $data abides an array of $rules
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$rules |
array|callable |
abidesAny
Check if $data abides any of an array of $rules
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$rules |
string|array|callable |
add
Add mixed $data to other mixed data cleverly
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
dd
Dump $data and die
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
dump
Dry dump $data for debug
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
merge
Merge mixed $data to other mixed data cleverly
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
getShallowType
Get a simplified type of a variable.
Return values: string|array|object|number|boolean|unknown
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
get
Get a value of a $collection by a $key of $separator notation with $default fallback
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$key |
string | |
$default |
mixed | |
$separator |
string |
group
Group values from a $collection according to the results of a $callback
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$callback |
callable |
keys
Get keys from a $collection
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object |
remove
Remove a $key value in a $collection using $separator notation.
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$key |
string|array | |
$separator |
string |
set
Set a $value in a $collection using $separator notation.
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$key |
string | |
$value |
mixed | |
$separator |
string |
sort
Sort a $collection by value, by a closure or by a property $sorter along a $direction
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$direction |
string | |
$sorter |
null|callable|string |
sortKeys
Sort a $collection by keys or properties by $direction
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$direction |
string |
values
Get values from a $collection
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object |
Func
- Full name: \Utility\Func
cache
Cache the return of a $function and return the value from cache in subsequent calls
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$function |
callable |
call
Call a $function with $arguments whether it is a reference array string or an anonymus function
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$function |
null|callable | |
$arguments |
array |
once
Limit a $function to be only called once
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$function |
callable | |
$unique |
boolean |
only
Limit a $function to be only called a certain number of $times
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$function |
callable | |
$times |
integer | |
$unique |
boolean |
throttle
Throttle a $function so that it can only be called once in every $miliseconds
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$function |
callable | |
$miliseconds |
integer |
Geo
- Full name: \Utility\Geo
address
Get lat lng data from an address
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$address |
string | |
$apiParameters |
array |
addressDistance
Calculate the distance between 2 pairs of lat and lng values
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$address1 |
string | |
$address2 |
string | |
$apiParameters |
array | |
$unit |
string |
distance
Get the distance between 2 pairs of lat and lng values in various units
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$lat1 |
float | |
$lng1 |
float | |
$lat2 |
float | |
$lng2 |
float | |
$unit |
string |
getAddress
Get geo data from an address
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$address |
string | |
$apiParameters |
array |
getDistance
Calculate the distance between 2 pairs of lat and lng values
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$lat1 |
float | |
$lng1 |
float | |
$lat2 |
float | |
$lng2 |
float |
Misc
- Full name: \Utility\Misc
abides
Check if $data abides an array of $rules
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$rules |
array|callable |
abidesAny
Check if $data abides any of an array of $rules
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$rules |
string|array|callable |
add
Add mixed $data to other mixed data cleverly
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
dd
Dump $data and die
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
dump
Dry dump $data for debug
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
merge
Merge mixed $data to other mixed data cleverly
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
getShallowType
Get a simplified type of a variable.
Return values: string|array|object|number|boolean|unknown
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
Num
- Full name: \Utility\Num
- Parent class: \Utility\Misc
abides
Check if $data abides an array of $rules
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$rules |
array|callable |
abidesAny
Check if $data abides any of an array of $rules
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$rules |
string|array|callable |
add
Add mixed $data to other mixed data cleverly
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
dd
Dump $data and die
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
dump
Dry dump $data for debug
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
merge
Merge mixed $data to other mixed data cleverly
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
getShallowType
Get a simplified type of a variable.
Return values: string|array|object|number|boolean|unknown
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
accord
Parse the $plural or $singular or $none template of a $number
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
float | |
$plural |
string | |
$singular |
string | |
$none |
string |
fileSize
Get filesize from $bytes
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$bytes |
float | |
$decimals |
integer |
format
Format $number
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
float | |
$decimals |
integer | |
$decimalPoint |
\Utility\string | |
$thousandSeparator |
\Utility\string |
isBetween
Check if $number is between $min and $max
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
float | |
$min |
float | |
$max |
float |
isEven
Check if a $number is even
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
float |
isNegative
Check if a $number is negative
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
float |
isOdd
Check if a $number is odd
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
float |
isOutside
Check if a $number is outside of $min and $max
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
float | |
$min |
float | |
$max |
float |
isPositive
Check if a $number is positive
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
float | |
$zeroIncluded |
boolean |
limit
Limit $number to $min and $max values
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
float | |
$min |
float | |
$max |
float |
max
Limit $number to a $max value
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
float | |
$max |
float |
min
Limit $number to a $min value
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
float | |
$min |
float |
ordinal
Get the ordinal form of a $number using a $template
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
float | |
$template |
string |
pad
Pad a $number to a $length with $pad from a $direction
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
float | |
$length |
integer | |
$pad |
string | |
$direction |
string |
percentOf
Check the percentage of $number relative to $normal
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
float | |
$normal |
float |
Obj
- Full name: \Utility\Obj
- Parent class: \Utility\Collection
get
Get a value of a $collection by a $key of $separator notation with $default fallback
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$key |
string | |
$default |
mixed | |
$separator |
string |
group
Group values from a $collection according to the results of a $callback
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$callback |
callable |
keys
Get keys from a $collection
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object |
remove
Remove a $key value in a $collection using $separator notation.
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$key |
string|array | |
$separator |
string |
set
Set a $value in a $collection using $separator notation.
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$key |
string | |
$value |
mixed | |
$separator |
string |
sort
Sort a $collection by value, by a closure or by a property $sorter along a $direction
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$direction |
string | |
$sorter |
null|callable|string |
sortKeys
Sort a $collection by keys or properties by $direction
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object | |
$direction |
string |
values
Get values from a $collection
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$collection |
array|object |
abides
Check if $data abides an array of $rules
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$rules |
array|callable |
abidesAny
Check if $data abides any of an array of $rules
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$rules |
string|array|callable |
add
Add mixed $data to other mixed data cleverly
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
dd
Dump $data and die
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
dump
Dry dump $data for debug
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
merge
Merge mixed $data to other mixed data cleverly
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
getShallowType
Get a simplified type of a variable.
Return values: string|array|object|number|boolean|unknown
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
has
Check if an $object has a $key (property or method)
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$object |
**** | |
$key |
string |
properties
Get all properties from an $object
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$object |
object |
methods
Get all methods from an $object
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$object |
object |
unpack
Unpack an $attribute from an $object
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
object | |
$attribute |
null|string |
Str
- Full name: \Utility\Str
- Parent class: \Utility\Misc
abides
Check if $data abides an array of $rules
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$rules |
array|callable |
abidesAny
Check if $data abides any of an array of $rules
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$rules |
string|array|callable |
add
Add mixed $data to other mixed data cleverly
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
dd
Dump $data and die
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
dump
Dry dump $data for debug
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
merge
Merge mixed $data to other mixed data cleverly
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
getShallowType
Get a simplified type of a variable.
Return values: string|array|object|number|boolean|unknown
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed |
accord
Get $plural or $singular string depending on $number
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
string|float | |
$plural |
string | |
$singular |
string | |
$none |
string |
alpha
Convert a $string to alpha
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
alphaNumeric
Convert a $string to alpha numeric
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
append
Add $append to $string at the end
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$append |
string |
ascii
Convert a $string to ASCII removing all accents
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$language |
string | |
$removeUnsupported |
boolean |
at
Get character at a specific $index from a $string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$index |
integer | |
$encoding |
null|string |
base64
Base 64 encode a $string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
between
Get part of a $string between $start and $end substrings
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$start |
string | |
$end |
string | |
$offset |
integer | |
$encoding |
null|string |
bool
Convert a $string to a bool
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$trueValues |
array | |
$falseValues |
array |
camel
Convert a $string to camelCase using a specific $language
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$language |
string |
chars
Get all distinct characters of a $string as an array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$encoding |
null|string |
clean
Normalize and trim a $string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
collapse
Ensure all white space characters only appear once in a $string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
common
Find a common sub string from $string and $otherString
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$otherString |
string | |
$encoding |
null|string |
commonPrefix
Find a common prefix from $string and $otherString
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$otherString |
string | |
$encoding |
null|string |
commonSuffix
Find a common suffix from $string and $otherString
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$otherString |
string | |
$encoding |
null|string |
contains
Check if $string contains $needle
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$needle |
string | |
$caseSensitive |
boolean | |
$encoding |
null|string |
containsAll
Check if $string contains all substrings in a $needles array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$needles |
array | |
$caseSensitive |
boolean | |
$encoding |
null|string |
containsAny
Check if $string contains any substrings in a $needles array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$needles |
array | |
$caseSensitive |
boolean | |
$encoding |
null|string |
count
Count the characters in $string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$encoding |
null|string |
dashed
Delimit $string with dashes instead of spaces
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
delimit
Connect words with $delimiter instead of spaces in $string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$delimiter |
string | |
$encoding |
null|string |
endsWith
Check if $string ends with $needle
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$needle |
string | |
$caseSensitive |
boolean | |
$encoding |
null|string |
endsWithAny
Check if $string ends with any of the $needles
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$needles |
array | |
$caseSensitive |
boolean | |
$encoding |
null|string |
ensureLeft
Esnure $string starts with $ensure
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$ensure |
string |
ensureRight
Ensure $string ends with $ensure
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$ensure |
string |
fileSize
Return a formatted filesize from $bytes
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$bytes |
float|string | |
$decimals |
integer |
first
Get first $number characters from $string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$number |
integer | |
$encoding |
null|string |
htmlDecode
HTML decode $string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$flags |
string | |
$encoding |
null|string |
htmlEncode
HTML encode $string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$flags |
string | |
$encoding |
null|string |
index
Get position of $needle within $string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$needle |
string | |
$offset |
integer | |
$encoding |
null|string |
indexes
Get all positions of $needle within $string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$needle |
string | |
$encoding |
null|string |
insert
Push $insert into $string at the $index character
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$insert |
string | |
$index |
integer | |
$encoding |
null|string |
isAlpha
Check if $string is alfa
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
isAlphanumeric
Check if $string is alfa numeric
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
isBase64
Check if $string is base 64 encoded
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
isBlank
Check if $string is empty or has only white space
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
isEmail
Check if $string is a valid email
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
isHexadecimal
Check if $string is hexadecimal
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
isHTML
Check if $string contains HTML code
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
isIP
Check if $string is a valid IP address
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
isJSON
Check if $string is valid JSON
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
isLower
Check if $string is lower-case
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
isRegex
Check if $string is a valid regex
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$pattern |
string |
isSerialized
Check if $string is serialized
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
isUpper
Check if $string is upper case
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
isURL
Check if $string is a valid URL
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
last
Get the last $number characters of a $string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$number |
integer | |
$encoding |
null|string |
lastIndex
Get last position of $needle in $string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$needle |
string | |
$offset |
integer | |
$encoding |
null|string |
length
Count length of $string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$encoding |
null|string |
limit
Safely truncate $string in $length
Str::limit( string $string, integer $length, string $append = '...', null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$length |
integer | |
$append |
string | |
$encoding |
null|string |
limitWords
Limit $string to a $limit of words
Str::limitWords( string $string, integer $length, \Utility\string $append = '...' ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$length |
integer | |
$append |
\Utility\string |
lines
Get an array of lines in $string
Str::lines( string $string, boolean $trimEachLine = false ): array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$trimEachLine |
boolean |
lower
Convert $string to lower case
Str::lower( string $string, null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$encoding |
null|string |
lowerFirst
Convert the first character of each word in $string to lower case
Str::lowerFirst( string $string, null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$encoding |
null|string |
matches
Check if $string matches $pattern
Str::matches( string $string, string $pattern ): boolean
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$pattern |
string |
normalize
Convert punctuation characters to a standardised, simpler version
Str::normalize( string $string ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
ordinal
Get ordinal version of $number according to $template
Str::ordinal( string|float $number, string $template = '%number<sup>%ordinal</sup>' ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$number |
string|float | |
$template |
string |
pad
Add $pad to $string until it reaches $length
Str::pad( string $string, integer $length, string $pad = ' ', string $direction = 'right', null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$length |
integer | |
$pad |
string | |
$direction |
string | |
$encoding |
null|string |
padBoth
Add $pad to both ends of a $string until it reaches $length
Str::padBoth( string $string, integer $length, string $pad = ' ', null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$length |
integer | |
$pad |
string | |
$encoding |
null|string |
padLeft
Add $pad to the left side of a $string until it reaches $length
Str::padLeft( string $string, integer $length, string $pad = ' ', null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$length |
integer | |
$pad |
string | |
$encoding |
null|string |
padRight
Add $pad to the right side of a $string until it reaches $length
Str::padRight( string $string, integer $length, string $pad = ' ', null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$length |
integer | |
$pad |
string | |
$encoding |
null|string |
pascal
Convert $string to PascalCase
Str::pascal( string $string ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
prepend
Add $prepend at the beginning of $string
Str::prepend( string $string, string $prepend ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$prepend |
string |
random
Generate random or $readable random string of $length
Str::random( integer $length = 10, boolean $readable = true ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$length |
integer | |
$readable |
boolean |
regexReplace
Replace $pattern with $replacement in $string
Str::regexReplace( string $string, string|array $pattern, string|array $replacement ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$pattern |
string|array | |
$replacement |
string|array |
remove
Remove $search pattern from $string
Str::remove( string $string, string $search ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$search |
string |
removeLeft
Remove $needle from the beginning of $string
Str::removeLeft( string $string, string $needle, boolean $caseSensitive = false, null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$needle |
string | |
$caseSensitive |
boolean | |
$encoding |
null|string |
removeRight
Remove $needle from the end of $string
Str::removeRight( string $string, string $needle, boolean $caseSensitive = false, null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$needle |
string | |
$caseSensitive |
boolean | |
$encoding |
null|string |
repeat
Repeat $string $times
Str::repeat( string $string, \Utility\int $times ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$times |
\Utility\int |
replace
Replace $search string with $replacement in $string
Str::replace( string $string, string $search, string $replacement ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$search |
string | |
$replacement |
string |
reverse
Reverse the characters of $string
Str::reverse( string $string, null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$encoding |
null|string |
shuffle
Randomly shuffle the characters of $string
Str::shuffle( string $string, null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$encoding |
null|string |
slice
Cut $string from $start to $end
Str::slice( string $string, integer $start, null|integer $end = null, null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$start |
integer | |
$end |
null|integer | |
$encoding |
null|string |
slug
Convert $string to slug-case
Str::slug( string $string, string $language = 'en' ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$language |
string |
slugify
Remove special characters and change whitespace characters with $delimiter in $string
Str::slugify( string $string, string $delimiter = '-', string $language = 'en' ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$delimiter |
string | |
$language |
string |
snake
Convert $string to snake_case
Str::snake( string $string, string $language = 'en' ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$language |
string |
spacesToTabs
Convert spaces to tabs in $string
Str::spacesToTabs( string $string, integer $tabLength = 4 ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$tabLength |
integer |
split
Split $string at $pattern
Str::split( string $string, string $pattern = '', null|integer $limit = null ): array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$pattern |
string | |
$limit |
null|integer |
startsWith
Check if $string starts with $needle
Str::startsWith( string $string, string $needle, boolean $caseSensitive = false, null|string $encoding = null ): boolean
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$needle |
string | |
$caseSensitive |
boolean | |
$encoding |
null|string |
startsWithAny
Check if $string starts with any $needles
Str::startsWithAny( string $string, array $needles, boolean $caseSensitive = false, null|string $encoding = null ): boolean
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$needles |
array | |
$caseSensitive |
boolean | |
$encoding |
null|string |
stringReplace
Swap $search with $replacement in $string
Str::stringReplace( string $string, string $search, string $replacement ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$search |
string | |
$replacement |
string |
stripWhitespace
Remove all white space characters from $string
Str::stripWhitespace( string $string ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
sub
Cut $string from $start to a certain $length
Str::sub( string $string, integer $start, null|integer $length = null, null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$start |
integer | |
$length |
null|integer | |
$encoding |
null|string |
tabsToSpaces
Convert tabs to spaces in $string
Str::tabsToSpaces( string $string, $tabLength = 4 ): array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$tabLength |
**** |
template
Replace template variables in $string according to associate $data array
Str::template( string $string, array $data = array(), string $varSymbol = '%' ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$data |
array | |
$varSymbol |
string |
timesContains
Count how many times $string contains $needle
Str::timesContains( string $string, string $needle, boolean $caseSensitive = false, null|string $encoding = null ): integer
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$needle |
string | |
$caseSensitive |
boolean | |
$encoding |
null|string |
title
Convert $string to Title Case
Str::title( string $string, null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$encoding |
null|string |
titlize
Convert $string to Title Case with an $ignore list of words that would not be converted to uppercase
Str::titlize( string $string, array $ignore = array(), null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$ignore |
array | |
$encoding |
null|string |
trim
Trim $characters from each end of a $string
Str::trim( string $string, string $characters = ' ' ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$characters |
string |
trimLeft
Trim $characters from the left side of $string
Str::trimLeft( string $string, string $characters = ' ' ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$characters |
string |
trimRight
Trim $characters from the right side of $string
Str::trimRight( string $string, string $characters = ' ' ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$characters |
string |
underscored
Replace spaces with _ (underscores) in $string
Str::underscored( string $string ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string |
upper
Convert string to UPPER CASE
Str::upper( string $string, null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$encoding |
null|string |
upperFirst
Upper Case first character of each word in $string
Str::upperFirst( string $string, null|string $encoding = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$encoding |
null|string |
words
Get an array of words from $string
Str::words( string $string, boolean $unique = true ): array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$unique |
boolean |
URL
- Full name: \Utility\URL
auth
Add $user and $pass to a $url
URL::auth( null|string|array $url, string $user, null|string $pass = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$user |
string | |
$pass |
null|string |
build
Build a URL from a parsed array
URL::build( array $url ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
array |
current
Get the current URL or its $parts
URL::current( array $parts = array() ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$parts |
array |
fragment
Get or $set the fragment of a $url
URL::fragment( null|string|array $url, null|string $set = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$set |
null|string |
fragmentSet
Set $fragment part of a $url
URL::fragmentSet( null|string|array $url, string $fragment ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$fragment |
string |
host
Get or $set the host of a $url
URL::host( null|string|array $url, null|string $set = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$set |
null|string |
hostSet
Set $host part of a $url
URL::hostSet( null|string|array $url, string $host ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$host |
string |
parse
Consistently parse $url
URL::parse( string $url ): array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
string |
parts
Get $parts of a $url
URL::parts( null|string|array $url, $parts = array('scheme', 'host', 'path') ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$parts |
**** |
pass
Get the pass part of a $url
URL::pass( null|string|array $url ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array |
path
Get or $set the path of a $url
URL::path( null|string|array $url, null|string $set = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$set |
null|string |
pathRemove
Remove $search string or pattern from $url path
URL::pathRemove( null|string|array $url, \Utility\string $search ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$search |
\Utility\string |
pathSet
Set $path part of a $url
URL::pathSet( null|string|array $url, null|string $path ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$path |
null|string |
port
Get or $set the port of a $url
URL::port( null|string|array $url, boolean $set = false ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$set |
boolean |
portSet
Set $port part of a $url
URL::portSet( null|string|array $url, string|integer $port ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$port |
string|integer |
query
Get or $set the query of a $url
URL::query( null|string|array $url, boolean $set = false ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$set |
boolean |
queryAdd
Add a parameter $key and $value to the query of the $url
URL::queryAdd( null|string|array $url, string $key, mixed $value ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$key |
string | |
$value |
mixed |
queryArray
Get the array of query args from a $url
URL::queryArray( null|string|array $url ): array
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array |
queryGet
Get a query parameter from a URL
URL::queryGet( null|string|array $url, string $parameter ): string|null
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$parameter |
string |
queryRemove
Remove a parameter by $key from the query of the $url
URL::queryRemove( null|string|array $url, $keys ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$keys |
**** |
querySet
Set the $url path part to $data
URL::querySet( null|string|array $url, string|array $data ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$data |
string|array |
scheme
Get or $set the scheme of a $url
URL::scheme( null|string|array $url, null|string $set = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$set |
null|string |
schemeSet
Set $scheme part of a $url
URL::schemeSet( null|string|array $url, null|string $scheme ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$scheme |
null|string |
user
Get the user part of a $url
URL::user( null|string|array $url, null|string $set = null ): string
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$url |
null|string|array | |
$set |
null|string |
This document was automatically generated from source code comments on 2019-08-07 using phpDocumentor and cvuorinen/phpdoc-markdown-public