fork download
  1. <?php
  2.  
  3. $channel ['items']['post']['categories'][]['Baby']['details'][] = array(
  4. 'title' => 'trying with category id again',
  5. 'price' => '3344.55',
  6. 'date_time' => '2013-11-11 17:33:49',
  7. 'description' => 'Descriptor sb',
  8. 'category_id' => '3'
  9.  
  10. );
  11.  
  12. $channels = array($channel);
  13. $json = json_encode($channel, JSON_PRETTY_PRINT);
  14. echo $json;
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
{
    "items": {
        "post": {
            "categories": [
                {
                    "Baby": {
                        "details": [
                            {
                                "title": "trying with category id again",
                                "price": "3344.55",
                                "date_time": "2013-11-11 17:33:49",
                                "description": "Descriptor sb",
                                "category_id": "3"
                            }
                        ]
                    }
                }
            ]
        }
    }
}