jueves, 22 de diciembre de 2022

print the max value of an array

 <?php


$array = array(1, "hello", 1, "world", "hello",1,1,1,1);

print_r(max(array_count_values($array)));

?>


this first count the values, then  print the max value, Will print 6, as there are 6 1

?>

No hay comentarios:

Publicar un comentario