D
D
DarkKefir2019-03-23 00:13:18
PHP
DarkKefir, 2019-03-23 00:13:18

Outputting JSON parsing results?

Fulfilling

<?php

$result = json_decode($result, true);

print_r($result);

I receive
Array ( 
    [0] => Array (
           [id] => 1 
          [name] => token
             ) 
)

How can I get the value of name in this array?
Options
echo $result->array[0]->{'name'};
echo $result->array[0]->name;
echo $result->{
  '0' => {'name'}
};

Didn't give any result.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MSAFT, 2019-03-23
@DarkKefir

Try like this:
echo $result[0]['name'];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question