Convert
objectToArray
converts any object into array.
Convert::objectToArray(mixed $mObject) : mixed
Example
$aObject = Convert::objectToArray(
$oObject
);
// array
var_dump(
gettype($aObject)
);
boolToString
converts true
into 'true'
and false
into 'false'
. Well of course it does not really convert the original value, but gives you a string representation of that value.
Convert::boolToString(bool $bValue) : string
$sBool = Convert::boolToString(
true
);
// type: string
// 'true'
var_dump(
$aObject
);
constValueToKey
returns constant name on its integer value - works for php
constants.
Convert::constValueToKey(int $iValue, array $aConstant = array()) : string
Example
$sLevel = Convert::constValueToKey(1024); # E_USER_NOTICE
Result
// type: string
'E_USER_NOTICE'