Created
May 16, 2020 22:28
-
-
Save gokhancerk/cb6a62ee4c51cea648cabd198fe2d8dd to your computer and use it in GitHub Desktop.
app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$house = file_get_contents('https://www.potterapi.com/v1/sortingHat?key=$2a$10$UL7Usqkb3s/o8PPz.ZOxxe3JJtOKObSTkaxqdeONfjp4RhKdMDQuS'); | |
?> | |
<p>Tebrikler! Seçmen şapka sizi <?php echo $house; ?>evine yerleştirdi.</p> | |
<?php | |
$characters = file_get_contents('https://www.potterapi.com/v1/characters?key=$2a$10$UL7Usqkb3s/o8PPz.ZOxxe3JJtOKObSTkaxqdeONfjp4RhKdMDQuS'); | |
$houses = file_get_contents('https://www.potterapi.com/v1/houses?key=$2a$10$UL7Usqkb3s/o8PPz.ZOxxe3JJtOKObSTkaxqdeONfjp4RhKdMDQuS'); | |
$speels = file_get_contents('https://www.potterapi.com/v1/spells?key=$2a$10$UL7Usqkb3s/o8PPz.ZOxxe3JJtOKObSTkaxqdeONfjp4RhKdMDQuS'); | |
$characters = json_decode($characters, true); | |
$decodedHouses = json_decode($houses, true); | |
$decodedSpells = json_decode($speels, true); | |
$characterNames = []; | |
$houseNames = []; | |
$spellNames = []; | |
foreach ($characters as $character) { | |
$characterNames[] = $character['name']; | |
} | |
foreach ($decodedHouses as $house) { | |
$houseNames[] = $house['name']; | |
} | |
foreach ($decodedSpells as $speel ) { | |
$spellNames[] = $speel['spell']; | |
} | |
// die(var_dump($houseNames)); | |
?> | |
<?php | |
echo '<h1>Characters</h1>'; | |
foreach ($characterNames as $name ) { | |
echo $name . '<br>'; | |
} | |
echo '<h1>House Name</h1>'; | |
foreach ($houseNames as $name ) { | |
echo "$name<br>"; | |
} | |
echo '<h1>Spell</h1>'; | |
foreach ($spellNames as $spell ) { | |
echo $spell . '<br>'; | |
} | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment