-1

JSON オブジェクトから情報をエコーする方法を教えてください。コードを以下に示します。

array(20) {
  [0]=>
  object(stdClass)#1 (15) {
    ["team_id"]=>
    int(10260)
    ["home"]=>
    object(stdClass)#2 (7) {
      ["played"]=>
      int(15)
    }
    ["away"]=>
    object(stdClass)#3 (7) {
      ["played"]=>
      int(15)
    }
    ["points"]=>
    int(77)
  }

たとえば、この配列から各チーム名をエコーする方法はありますか?

4

2 に答える 2

1

PHPを使用する必要がありますjson_decode

$obj = json_decode($getData);
$value= $obj->{'team-id'};
于 2013-04-02T18:02:59.343 に答える