vendredi 25 novembre 2022

Access numeric key in array php [duplicate]

I have a array with a key like "11_check". How to acess this using php/laravel?

            $check=$list[$i]->{11_check};

I'm trying to acess with {} but I'm getting the error

Parse error: syntax error, unexpected '_check' (T_STRING)

Solution:

            $check=$list[$i]->{'11_check'};


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire