fork download
  1. <?php
  2. $arr1 = ['option' => "nos", 'optioncost' => 10];
  3. $arr2 = ['option' => "opts", 'optioncost' => 20];
  4. $arr3 = ['option' => "opts", 'optioncost' => 30];
  5.  
  6. echo json_encode([$arr1, $arr2, $arr3]);
Success #stdin #stdout 0.02s 23572KB
stdin
Standard input is empty
stdout
[{"option":"nos","optioncost":10},{"option":"opts","optioncost":20},{"option":"opts","optioncost":30}]