Skip to content
Advertisement

Tag: json

PHP Encoding JSON Issue

I wanna json encode a PHP array to send it for a server, but the server wants it in this format: [{ “key1”: “value1”, “key2”: “value2”, “key3”: “…

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 …

Backslash in json_encode (PHP) + JSON_ARRAYAGG (mySQL)

The problem is the backslashes with the quotes in the array colors. I think it’s because the JSON_ARRAYAGG but I don’t know how to print a correct json. Query: PHP: OUTPUT: Answer You are encoding colors twice. First in SQL and then in PHP. What you can do is either decode colors in PHP before you encode $data: If you

Advertisement