3
I have a problem to convert some data into my system, I have the following code snippet that returns an array with a few objects:
Array(
    [4014] => stdClassObject([id] => 4014[registro] => 9877[sigla] => total)
    [4006] => stdClassObject([id] => 4006[registro] => 9877[sigla] => Parcial)
)
I need to convert these objects to an array to upload to a webservice in which the webservice pattern is described below:
Final Goal :
Array(
    [lista] => Array(
        [0] => Array(
            [registro] => 7069[sigla] => Parcial
        ) [1] => Array(
            [registro] => 7069[sigla] => Total
        ) 
    )
)
What I’ve been able to implement is this:
$dados = $DB->return_records($query);
foreach($dados as $dado) {
   $listagem['lista'][]= $dado;
}
And has returned the following excerpt:
Array(
    [lista] => Array(
                    [0] => stdClassObject([id] => 4014[registro] => 9877[sigla] => total)
                    [1] => stdClassObject([id] => 4006[registro] => 9877[sigla] => parcial)
                )
    )
Now I’m trying to generate the result of block 2, but I still can’t, someone could help me?
You’re boring in Miguel Rsrsrs, that’s all kkkkkk.
– tkmtts
:p boring?! why? @tkmattos
– Miguel
Pq was very quick and surgeon in response. Brigadeo my dear
– tkmtts
hehe de nada @tkmattos, I’m glad you solved . I’ve also been through this a lot, so know soon
– Miguel
It’s the evil of PHP KKKK typing
– tkmtts
True, I don’t really like the syntax @tkmattos either
– Miguel