valor máximo de un array - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of valor máximo de un array .php

  1. <?php
  2.  
  3. $alumnos=array("Pepe" => 8, "Eduardo" => 5, "Hans" => 9, "Sara" => 7, "Vero" => 5);
  4.  
  5. $mayor = max($alumnos);
  6.  
  7. $newarray = array_flip($alumnos);
  8.  
  9. echo $newarray[$mayor];
  10.  
  11.  
File Description
  • valor máximo de un array
  • PHP Code
  • 15 Oct-2021
  • 177 Bytes
You can Share it: