André, come on, come on.
The var_dump() tool is very interesting because you understand the type of return you have. On your return we had the following:
array(1) {
[0]=>
object(stdClass)#144 (1) {
["parcela_number"]=>
int(3)
}
}
you note that the $parcela
is a array
. And then we have a objeto
. The way to access data from array
and of a objeto
are different, so was not getting before. And for being a array
we cannot access the data via ->
and yes by position (index).
I make a foreach()
in its variable $parcelas
you will be able to retrieve the data via $parcela->
I can’t create a code for you, because I need more code from you to give you a practical example, but I believe you can easily.
To solve your problem do: $parcelas[0]->parcela_number;
put, please, the var_dump($installments); then I can help you
– user148170
Okay, I’ve posted the var_dump
– André Cabral
ok try this: $parcelas[0]->parcela_number;
– user148170
It worked, only I did not understand why, in another similar case works so $parcels[0]->value.
– André Cabral