'; echo $img; } else { echo 'Server is offline.'; } // Uncomment the line below to see what's returned // var_dump($ping); /* Textures / Skins ---------------------------*/ $uuid = '069a79f4-44e9-4726-a5be-fca90e38aaf5'; $size = 80; // We try to fetch player's head $head = MojangAPI::getPlayerHead($uuid, $size); // We can't get his head if (empty($head)) { // So we get default skin if (MojangAPI::isAlex($uuid)) { $head = MojangAPI::getAlexHead($size); } else { $head = MojangAPI::getSteveHead($size); } } // And print it directly with tag $img = 'Skin head'; echo $img; /* Authentication ---------------------------*/ $result = MojangAPI::authenticate('username@gmail.com', '123456'); if ($result) { echo 'Welcome ' . $result['name'] . ', your UUID is: ' . $result['id']; } else { echo 'Sorry, authentication failed.. :('; }