Skip to content

Instantly share code, notes, and snippets.

@Daltontastic
Last active February 18, 2017 11:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daltontastic/cbeddcba4b6d5f47c1bdd2eec422a524 to your computer and use it in GitHub Desktop.
Save Daltontastic/cbeddcba4b6d5f47c1bdd2eec422a524 to your computer and use it in GitHub Desktop.
<?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