This website uses Cookies to provide you with the best possible service. Please see our Privacy Policy for more information. Click the check box below to accept cookies. Then confirm with a click on "Save".  
Status: 2023-12-28

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'