Example #1
0
<?php

include "../src/helpers.php";
$input = "";
$result = ObtainArray($input);
var_dump($result);
Example #2
0
/**
 * (macro) ObtainArray
 * Converts an mixed array/object to an array.
 *
 * @param input             Any object
 */
function ObtainArray($input)
{
    $result = [];
    foreach ($input as $key => $value) {
        if (is_object($value)) {
            $value = ObtainArray($value);
        }
        $result[$key] = $value;
    }
    return (array) $result;
}