I'm starting now with the most complex queries within PHP. As I have always played WoW I decided to learn a little about API with PHP using the Blizzard API that gives me some information.
After much searching I was able to pull the information into a table, but I had a question: using the pets search as an example, and if I wanted my list to bring me only the pets with a level higher than 10 (pets- > collected- > stats- > level)
Below is the code for how he is returning a table with all the pets and some information
The full json url is: link
<?php
$type = 'character';
$reino = 'Goldrinn';
$char = 'Lokinhaa';
$language = 'pt_BR';
$fields = 'pets';
$api_key = '3ps9yqk69mhjhy435m8sq4razamkwy25';
$url = "https://us.api.battle.net/wow/$type/$reino/$char?fields=$fields&locale=$language&apikey=$api_key"; // path to your JSON file
$data = file_get_contents($url); // put the contents of the file into a variable
$characters = json_decode($data, true); // decode the JSON feed
$pets = $characters['pets']['collected'];
?>
<table>
<tbody>
<tr>
<th>Pet</th>
<th>Spell</th>
<th>Level</th>
<th>Health</th>
<th>Power</th>
<th>Speed</th>
</tr>
<?php foreach ($pets as $pet) : ?>
<tr>
<td> <?php echo $pet['name']; ?> </td>
<td> <?php echo $pet['spellId']; ?> </td>
<td> <?php echo $pet['stats']['level']; ?> </td>
<td> <?php echo $pet['stats']['health']; ?> </td>
<td> <?php echo $pet['stats']['power']; ?> </td>
<td> <?php echo $pet['stats']['speed']; ?> </td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
?>