I have an arrays like follows:
Array
(
[option] => nos
[optioncost] => 10
)
Array
(
[option] => opts
[optioncost] => 20
)
Array
(
[option] => opts
[optioncost] => 30
)
need to convert this as like the following json format
[{"option":nos,"optioncost":10},{"option":opts,"optioncost":20},{"option":optse,"optioncost":30}]
$arr=[$arr1,$arr2,$arr3];.