T
T
truejunya2019-09-13 02:00:54
PHP
truejunya, 2019-09-13 02:00:54

Why is the Json file not being read?

Hello, such a problem.
there is a file $peer_id.json And there is Php code
[{"id":522921916,"stage":"0"}]

$info = json_decode(file_get_contents('files/'.$peer_id.'.json'));
  $stage = $info->{'stage'};

As a result, the stage variable is empty, why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dollar, 2019-09-13
@truejunya

$stage = $info[0]->{'stage'};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question