Can some one help me with this problem? i want to get every prefix from every server.
My error: Fatal error: Uncaught TypeError: Cannot access offset of type string on string in test.php:67 Stack trace: #0 {main} thrown in C:\xampp\htdocs\GameServer Status\test.php on line 67
// JSON string
$someJSON = https://api.gametools.network/bf1/servers/?name=lo&lang=en-us®ion=all&platform=pc&limit=2 (in a URL because of space)
// Loop through Array
$someArray = json_decode($someJSON['servers'], true); // Replace ... with your PHP Array
foreach ($someArray as $key => $value) {
echo $value["prefix"];
}
?>