function myfunction($v){
if ($v==="Dog"){
return "Fido";
}
return $v;
}
$a=array("Horse","Dog","Cat");
print_r(array_map("myfunction",$a));
function myfunction($v){
$v=strtoupper($v);
return $v;
}
$a=array("Animal" => "horse", "Type" => "mammal");
print_r(array_map("myfunction",$a));