q
Quantity resolver.
q($value);
This function does the following tasks:
- Count the length of a string.
- Count array values.
- Count
Traversable
class instance. - Convert standard PHP object into plain array and count it as array.
- Return
1
if value istrue
. - Return
0
if value is eitherfalse
ornull
. - Return the integer and float value anyway.
- Count any input with PHP
count()
function anyway.