SHARE
TWEET

php max

Nuralam13 Sep 14th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $array=array(12,45,25,65,-7);
  3. $max=-70;
  4. $len = count($array);
  5. for($i=0;$i<$len;$i++){
  6. if($max<$array[$i]){
  7.     $max =$array[$i];
  8. }
  9.    
  10. }
  11.  
  12. echo "The maximum number is:".$max;
  13. ?>
RAW Paste Data
Top