How to add document into sync gateway using php with Guzzle

Hi , I need to add document like following json format.
json file

{
  "description": "pp",
  "image_path": "NO_IMG",
  "item_category": {
    "catColor": 4,
    "catId": "category_0d9b2a78-b06f-4a7e-8e9d-9b133ff4e8fe",
    "catName": "cat_004",
    "itemCount": 0
  },
  "item_color": 1,
  "item_id": "item_dfab1684-c3c3-46b1-99b7-b342946c6187",
  "item_name": "pp",
  "price_variations": [
    {
      "price": "120",
      "sku": "pp",
      "variationId": null,
      "variationName": "Regular"
    },
 {
      "price": "125",
      "sku": "ppr",
      "variationId": null,
      "variationName": "Regular"
    }
  ],
  "sku": "pp",
  "type": "item",
  "_rev": "1-5edd1027c325de6a73f72b089398f9b2",
  "_id": "item_.a2425a39-3f7a-49cd-93a2-8d7c8bcbc2ff"
}

My php code :

    $document_id = $this->docId('item');
    $item_category=array('catColor'=>$params['catColor'],
                         'catId'=>$this->docId('category'),//'catId'=>$params['catId'],
                         'catName'=>$params['catName'],
                         'itemCount'=>$params['itemCount']
                        );    
    $price_variations=array('price'=>$params['price'],
                            'sku'=>$params['price_sku'],
                            'variationId'=>$params['variationId'],
                            'variationName'=>$params['variationName']
                           );
    $data = array('description'=>$params['description'],
                  'image_path'=>$params['image_path'],
                  'item_category'=>$item_category,
                  'item_color'=>$params['item_color'],
                  'item_id'=>$this->docId('item'),
                  'item_name'=>$params['item_name'],                 
                  'price_variations'=>$price_variations,
                  'sku'=>$params['sku'],                 
                  'type'=> 'item'
                 );    

I am getting result like this :

{
  "description": "test item",
  "image_path": "NO_IMG",
  "item_category": {
    "catColor": 3,
    "catId": "category_a6e4f729-9bc6-45b8-7f52-9f5183c7e2b6",
    "catName": "cat_005",
    "itemCount": 0
  },
  "item_color": 4,
  "item_id": "item_50431f29-34c2-5e09-ba58-b1672a4f39c5",
  "item_name": "item_0007",
  "price_variations": {
    "price": 100,
    "price_sku": "200g_item_006",
    "variationId": 9001,
    "variationName": "test_001"
  },
  "sku": "test_item_001",
  "type": "item",
  "_rev": "1-6094e1e0b620041f55c3952b3c439e9e",
  "_id": "item_4e791f08-c917-194f-efc6-3ec908b27a14"
} 

How can i add multiple ‘price_variations’ using php? Can anyone help to me :frowning:
Thank q

I believe you need to use something like

$price_variations=array( array('price' => $params['price'], ... ), array(...), ...);

This Stack Overflow post might help: https://stackoverflow.com/questions/6739871/how-to-create-an-array-for-json-using-php

Thank q hod.greeley. It is working now.