function abbrevName(string $name): string {
$nameArray = explode(" ", $name); // Divise le nom en tableau
$initials = strtoupper($nameArray[0][0]) . '.' . strtoupper($nameArray[1][0]); // Forme les initiales
return $initials;
Catégories : PHP