ÇÖZÜLDÜ Json ile Bot yapımında veri listeleme sorunu

sem10line

LogoMerkezi.com
Moderatör
T.C. Onaylı
Katılım
9 Ara 2020
Mesajlar
374
Tepkime puanı
334
Puanları
93
Yaş
32
Konum
Üsküdar/İstanbul
Web sitesi
www.logomerkezi.com
Merhabalar gametracker ı biliyorsunuzdur oradan json api ile serverdaki anlık oyuncuların isimlerini vs. herşeyi çekebiliyorum bot yardımı ile fakat şöyle bir sorunum var oyuncuları listelemek istediğimde 1 tane gözüküyor foreach eklediğimde hata alıyorum bu kodlara ne eklemeliyim?

Kodlar:
Kod:
<?php
setlocale(LC_ALL, 'tr_TR.UTF-8');
$url = "http://api.gametracker.rs/demo/json/server_info/95.173.173.9:27015";
$client = curl_init($url);curl_setopt($client,CURLOPT_RETURNTRANSFER,true);
$response = curl_exec($client);
$sonuc = json_decode($response);
$oyuncu= $sonuc->players_list[0]->player->name;
$skor= $sonuc->players_list[0]->player->score;
$sure= $sonuc->players_list[0]->player->time; ?>
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">   
</head>   
<body>       
<br>
<br>
<table id="tablePreview" class="table">       
<thead>   
<tr>
<th>Oyuncular</th>     
<th>Skor</th>     
<th>Süre</th> 
</tr> 
</thead> 
<tbody>   
<tr>     
<td><?php echo $oyuncu;?></td>     
<td><?php echo $skor;?></td>     
<td><?php echo $sure;?></td>   
</tr>   
</tbody>
</table>   
</body>
</html>
 
Moderatör tarafında düzenlendi:
5,689Konular
16,883Mesajlar
9,790Kullanıcılar
TaytaySon üye
Üst