Skip to content

No distinction between array and object #16

@warlof

Description

@warlof

I want rendering an array of object so i do :

$data = $sqlFetchArray;

$arr = (array) array();

foreach ($data as $t) {
 $arr[] = (object) array('id' => $t[0], 'name' => $t[1]);
}

$app->render(200, $arr);

But i still get json object and no array of json object.

{
 0: {id: 144, name: 'warlof'},
 1: {id: 201, name: 'elfaus'}
}

instead of

[
 {id: 144, name: 'warlof'},
 {id: 201, name: 'elfaus'}
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions