Hello, I am developing dropshipping. There is json. I don’t understand how to build an array with sku so that I get this output: enter image description here

 $sku['sku']['colors'][0]['name'] = 'как на картинке'; $sku['sku']['colors'][1]['name'] = 'чёрный'; $sku['sku']['size'][0] = '36'; $sku['sku']['size'][1] = '35'; print_r($sku); 

In json everything is thrown out horribly, that is, one json for both view and comparison.

  • instead of a picture it would be better to bring the desired data structure - teran
  • Added, if you watched json you probably noticed that everything is solid, for example color: black can be found on two indices at once, it would be logical to separate color and size. - newProgrammer 9:10 pm

0