<?php

$total = 8;
$artists = array(
    "taylor-swift" => array("name" => "Taylor Swift", "genre" => "country"),
    "bts" => array("name" => "BTS", "genre" => "k-pop"),
    "drake" => array("name" => "Drake", "genre" => "hip-hop"),
    "the-weeknd" => array("name" => "The Weeknd", "genre" => "pop"),
    "justin-bieber" => array("name" => "Justin Bieber", "genre" => "pop-rock"),
    "harry-styles" => array("name" => "Harry Styles", "genre" => "pop"),
    "billie-eilish" => array("name" => "Billie Eilish", "genre" => "pop"),
    "ed-sheeran" => array("name" => "Ed Sheeran", "genre" => "pop"),
    "dua-lipa" => array("name" => "Dua Lipa", "genre" => "pop"),
    "the-1975" => array("name" => "The 1975", "genre" => "alternativo"),
    "bad-bunny" => array("name" => "Bad Bunny", "genre" => "reggaeton"),
    "rauw-alejandro" => array("name" => "Rauw Alejandro", "genre" => "reggaeton"),
    "j-balvin" => array("name" => "J Balvin", "genre" => "reggaeton"),
    "karol-g" => array("name" => "Karol G", "genre" => "reggaeton"),
    "anuel-aa" => array("name" => "Anuel AA", "genre" => "reggaeton"),
    "daddy-yankee" => array("name" => "Daddy Yankee", "genre" => "reggaeton"),
    "ozuna" => array("name" => "Ozuna", "genre" => "reggaeton"),
    "farruko" => array("name" => "Farruko", "genre" => "reggaeton"),
    "maluma" => array("name" => "Maluma", "genre" => "reggaeton"),
    "sebastian-yatra" => array("name" => "Sebastián Yatra", "genre" => "pop"),
    "olivia-rodrigo" => array("name" => "Olivia Rodrigo", "genre" => "pop"),
    "maneskin" => array("name" => "Måneskin", "genre" => "pop"),
    "glass-animals" => array("name" => "Glass Animals", "genre" => "alternativo"),
    "the-kid-laroi" => array("name" => "The Kid Laroi", "genre" => "hip-hop"),
    "nessa-barrett" => array("name" => "Nessa Barrett", "genre" => "pop"),
    "skrillex" => array("name" => "Skrillex", "genre" => "electronica"),
    "pinkpantheress" => array("name" => "PinkPantheress", "genre" => "pop"),
    "tai-verdes" => array("name" => "Tai Verdes", "genre" => "pop"),
    "conan-gray" => array("name" => "Conan Gray", "genre" => "pop"),
    "arlo-parks" => array("name" => "Arlo Parks", "genre" => "ryb"),
    "ptazeta" => array("name" => "Ptazeta", "genre" => "rap"),
    "nicki-nicole" => array("name" => "Nicki Nicole", "genre" => "rap"),
    "bizarrap" => array("name" => "Bizarrap", "genre" => "trap"),
    "maria-becerra" => array("name" => "María Becerra", "genre" => "pop"),
    "trueno" => array("name" => "Trueno", "genre" => "rap"),
    "lorde" => array("name" => "Lorde", "genre" => "pop"),
    "rels-b" => array("name" => "Rels B", "genre" => "reggaeton"),
    "paula-cendejas" => array("name" => "Paula Cendejas", "genre" => "rap"),
    "dylan-fuentes" => array("name" => "Dylan Fuentes", "genre" => "reggaeton"),
    "juan-pablo-vega" => array("name" => "Juan Pablo Vega", "genre" => "pop")
);

$keys = array_keys($artists);
shuffle($keys);

$html = '';
for ($i = 0; $i < $total; $i++) {
    $key = $keys[$i];
    $name = $artists[$key]['name'];
    $genre = $artists[$key]['genre'];
    $img_url = "https://tse2.mm.bing.net/th?q=" . urlencode($key) . "+artista&w=190&h=190&c=7&rs=1?.jpg";
    $html .= '<li><a href="/' . $genre . '/' . $key . '/"><div class="i"><img src="' . $img_url . '" alt="Musica de ' . $name . '"></div><h3 title="' . $name . '">' . $name . '</h3></a></li>' . "\n";
}

echo $html;

?>