Skip to content

json_encode(json_decode(json_encode($array))); shouldn't be necessary #18598

Closed as not planned
@Hanzerik

Description

@Hanzerik

Description

to get from

$array = ['foo' => "a", 'bar' => "b"];

to:

{
    "foo": "a",
    "bar": "b"
}

We currently need to create the following helperfunction:

    function arrayToJsonObject(array $array)
    {
       return  json_encode(json_decode(json_encode($array)));
    }

Would be really cool if that wasn't necessary

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions