Skip to content
Advertisement

Tag: arrays

Method to change specific value inside multidimensional array

Given a class with a multidimensional array as private property. I’m trying to write a method setValue() which could change any value of this private array by passing: some kind of path to a specific value (e.g. $path = [‘lorem’ => [‘ipsum’ => [‘dolor’ => [‘sit’ => null]]]];) the new value … Thanks to a comment of Gabriel on php.net

Replacing a JSON array in MySQL in PHP

I am trying to replace data in a JSON array inside a JSON array in my MySQL Database. The array looks like this: {“slug”: “SLUG”,”price”: “{“44″:12,”_default”:12}”, “test”: “TEST”} Now I would like …

Advertisement