0

how to get an array list into json format like json_encode([[money,1872416],[moneytransfer,1382619],[api,1986920]]).

My array looks like this:

Array
(
    [0] => Array
        (
            [0] => Array
                (
                    [money] => 1
                    [moneytransfer] => 4340
                    [api] => 6546
                )    
        )    
    [1] => Array
        (
            [0] => Array
                (
                    [money] => 2
                    [moneytransfer] => 546546
                    [api] => 6546
                )    
        )    
    [2] => Array
        (
            [0] => Array
                (
                    [money] => 3
                    [moneytransfer] => 6546
                    [api] => 6546
                )    
        )    
)
Dimitris Fasarakis Hilliard
  • 150,925
  • 31
  • 268
  • 253
John
  • 68
  • 5
  • This question has answered before : "[Can an array be top-level JSON-text?](http://stackoverflow.com/questions/3833299/can-an-array-be-top-level-json-text)" – Abdurrahim Oct 31 '15 at 11:21

1 Answers1

0

This question has answered before : "Can an array be top-level JSON-text?" –

Per the JSON RFC, an array is indeed legal top-level JSON-text: "A JSON text is a serialized object or array."

John
  • 68
  • 5