예제 #1
0
function things_to_fields($data)
{
    if (is_array($data)) {
        foreach ($data as $item_id => $item) {
            $data[$item_id] = things_to_fields($item);
        }
    } else {
        if ($data instanceof GP_Thing) {
            $data = $data->fields();
        }
    }
    return $data;
}
예제 #2
0
<?php

echo gp_json_encode(things_to_fields($projects_data));