0

I have this json data:

$my_data = '[
   {
      "rank":"4",
      "logo":"",
      "team":"FCB",
      "pld":"29",
      "won":"14",
      "draw":"6",
      "lost":"9",
      "left":"5",
      "minus":"30:44",
      "diff":"14",
      "pts":"48",
      "date":"Dec. 31st 69"
   }
]';

I wanted to get "rank" value using this code:

$data_get =  json_encode($my_data );
echo $data_get->rank;

i get this error

Trying to get property 'rank' of non-object in

jimi-del
  • 93
  • 1
  • 11

0 Answers0