Files
fusionpbx/app/fax/resources/functions/object_to_array.php
frytimo adfc4cc469 Create more documentation (#7627)
* Documentation, format class, no modification.
2025-11-18 18:33:07 -07:00

16 lines
512 B
PHP

<?php
/**
* Recursively converts an object or array to a multi-dimensional array.
*
* @param mixed $obj The object or array to be converted. If the value is neither an object nor an array, it will be returned as is.
*
* @return array A multi-dimensional array representation of the input object or array.
*/
function object_to_array($obj) {
if (!is_object($obj) && !is_array($obj)) { return $obj; }
if (is_object($obj)) { $obj = get_object_vars($obj); }
return array_map('object_to_array', $obj);
}
?>