I have an array that looks like this.
$data['id'][0] = 123;
$data['id'][1] = 302;
.... And so on, I have to convert this to an object like this,
$object = ['id' => [123, 302.....]];
I can't seem to achieve this in a way like this
$object = (object)$data;
How can I do this in PHP? What's the most efficient way of doing it. Thanks