Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
function prenomFiltre($prenoms){
$filtre = array_filter($prenoms, function($prenom){
return strlen($prenom) > 5 && strtolower(substr($prenom, 0, 1)) === 'a';
});
$resultat = array_map(function($prenom) {
return strtolower($prenom) . "⭐";
}, $filtre);
return $resultat;
}
$prenoms = ["Alice", "alexandre", "Bob", "Amélie", "Arthur", "Marc", "Antoine"];
$resultat = prenomFiltre($prenoms);
print_r($resultat)
?>