I have the following object:
$a = new stdClass;
$a->id = 1;
$a->nome = 'wallace';
$a->parentes = new stdClass;
$a->parentes->pai = 'Sidney';
$a->parentes->mae = 'Maria';
$a->parentes->esposa = 'Cirlene';
I know that with cast
it is possible to convert stdClass
to array
, but not recursively.
So how can I convert this object to array recursively?