I have an array i make in javascript with 2 columns id and quantity

```
items.push({
            id : id,
            quantity: quantity
        })

```

I then use stringify to make it into a jsonstring as shown

```
var jsonString = JSON.stringify(items);
    $.ajax({
            type: "POST",
            url: "order_process.php",
            data: {data : jsonString}, 
            cache: false,

            success: function(){

                window.location.href = "order_confirmation.php";

            }
});

```

I then post it to php and use json\_decode to turn it into a php array. as shown

```
$_SESSION['cart'] = json_decode( $_POST['data'] );

```

The problem is when i use the print\_r() function in php, this is the output I get

```
Array ( 
    [0] => stdClass Object ( [id] => 12 [quantity] => 1 ) 
    [1] => stdClass Object ( [id] => 13 [quantity] => 1 ) 
    [2] => stdClass Object ( [id] => 10 [quantity] => 1 ) 
)

```

The output I want is as shown below, but I don't know how to format this so I get it as shown

| ID | quantity |
| --- | --- |
| 12 | 1 |
| 13 | 2 |

Any help would be much appreciated