I have been curious about PHP lately and I am working on a test subject. I want to get the number of citizens from an online game and order it by Military rank.
Here is the link of the API: https://www.erevollution.com/en/api/citizenship/1
Here is the code I have so far.
<form action="index.php" method="post">
<input type="text" name="id"><br>
<input type="submit">
</form>
<?php
$okey= $_POST["id"];;
$jsonurl="https://www.erevollution.com/en/api/citizenship/".$okey;
$json = file_get_contents($jsonurl,0,null,null);
$json_output = json_decode($json);
echo "Players of albania are: <br>";
foreach ($json_output as $trend)
{
$id = $trend->ID;
echo " Name : {$trend->Name}
";
echo '<br>';
}