This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Parsec
Parsec

I have this JSON that is decoded.

The PHP way of accessing a bit of data is $array[elements][0]['active'].

I've tried:

array_set($form, 'elements[0].active', 'false'); array_set($form, 'elements.0.active', 'false'); array_set($form, "elements'0'.active", 'false');

But it won't work. I could not find anything in the documentation.

Goedda
Goedda

What do you mean? It does not set the value or it sets the string 'false' instead of the boolean FALSE and hence, somewhere in your code it does not recognise it then as boolean FALSE?

The correct notation should be imho:

array_set($form, 'elements.0.active', false;
Parsec
Parsec

That seems to have worked, but my underlying problem still prevents me from doing what I want.

Thanks for the answer

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.