i have data in this

```
 "method": [
        {
          "id": "626",
          "rating": "936.6"
        },
        {
          "id": "631",
          "rating": "332"
        }
      ]

```

I made a loop, in this script.. and I want to retrieve rating data based on index
because there is a special need, how?

```
<?php foreach($res['method'] as $key=>$row) { ?>    

    <?php echo [0]['rating']; ?> // rating index 0
    <?php echo [1]['rating']; ?> // rating index 1
    //I retrieve data by index this way but error Undefined index: rating

<?php } ?>

```