Last active
February 18, 2017 11:34
-
-
Save Daltontastic/cbeddcba4b6d5f47c1bdd2eec422a524 to your computer and use it in GitHub Desktop.
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 | |
function gamertag_exists($gamertag) | |
{ | |
$first_step = explode("<div id=\"Gamerscore\">", file_get_contents("https://gamercard.xbox.com/en-US/$gamertag.card")); | |
$second_step = explode("</div>", $first_step[1]); | |
$gamerscore = $second_step[0]; | |
if ($gamerscore != "--") { | |
return true; | |
} else { | |
return false; | |
} | |
} | |
if (gamertag_exists("DaltontasticMC")) { | |
echo "This gamertag exists."; | |
} else { | |
echo "This gamertag doesn't exist."; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment