If i have the uuid now it will come out like this 42f704ab4ae141c78c185558f9447748 But is it possible to let it string in this 42f704ab-4ae1-41c7-8c18-5558f9447748 so with dashes on the certain places
<?php
$playername = 'Vanture';
$url = "https://api.mojang.com/users/profiles/minecraft/" . urlencode($playername);
$result = file_get_contents($url);
$json = json_decode($result);
if ($json == NULL) {
echo("NULL returned - probably invalid playername");
} else {
$UUID = $json->id;
echo "$UUID $playername";
}
?>
Here's another way: