How do I get the first index of the array, name, with the most amount of characters? The output of the program should be "Camila Cabello".
function artistWithLongestName($artists) {
// Put your solution here
};
$artists = [
["name" => "Post Malone", "song" => "Circles", "genre" => "Pop"],
["name" => "Camila Cabello", "song" => "Liar", "genre" => "Pop"],
["name" => "Tones and I", "song" => "Dance Monkey", "genre" => "Alternative"],
["name" => "Billie Eilish", "song" => "Bad Guy", "genre" => "Alternative"],
];
echo "<p>".artistWithLongestName($artists)."</p>";