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'};


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/oXgRhl3
via IFTTT

Aucun commentaire:

Enregistrer un commentaire