我想知道,如何使用PHP:(Tile32px)值“http://360api.chary.us/?gamertag=superdeder”。
我试过这样做:
<?php
$json = file_get_contents('http://360api.chary.us/?gamertag=superdeder');
$gamer = json_decode($json);
echo $gamer->Gamertag;
echo "<br><br>";
$data = json_decode($json, true);
$users=$data['LastPlayed'];
foreach ($users as $user)
{
echo $user['Title'];
echo "<br>";
}
echo "<br>";
$users2=$data['Pictures'];
foreach ($users2 as $user2)
{
echo $user2['Tile32px'];
echo "<br>";
}
?>
其结果是:
SuperDeder
Skyrim大盗用汽车V国际足联13 L.A.黑线WSOP:全屋专业版
H h h
非常感谢。
安德里亚。
发布于 2014-10-28 10:59:59
试试这边。
<?php
$json = file_get_contents('http://360api.chary.us/?gamertag=superdeder');
$data = json_decode($json, true);
foreach ($data['LastPlayed'] as $val)
{
echo $val['Pictures']['Tile32px'];
echo "<br>";
}
?>
发布于 2014-10-28 11:04:13
尝尝这个
<?php
$json = file_get_contents('http://360api.chary.us/?gamertag=superdeder');
$gamer = json_decode($json, true);
$users = $gamer['LastPlayed'];
foreach($users as $user){
echo $user['Pictures']['Tile32px'];
echo '<br>';
}
?>
https://stackoverflow.com/questions/26606514
复制相似问题