note 75208 modified in function.max by danbrown

From: Date: Tue, 22 Mar 2011 14:01:25 +0000
Subject: note 75208 modified in function.max by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-178091@lists.php.net to get a copy of this message
To find the maximum value from a set of 1-dimensional arrays, do this: <?php $d1 = array(450,420,440,430,421); $d2 = array(460,410,410,430,413,375,256,411,656); $d3 = array(430,440,470,435,434,255,198); $t = max(max($d1),max($d2),max($d3)); // $t is 656 ?> The inner max() functions operate on the arrays, the outer max compares the numeric results of the inner ones. --was-- To find the maximum value from a set of 1-dimensional arrays, do this: $d1 = array(450,420,440,430,421); $d2 = array(460,410,410,430,413,375,256,411,656); $d3 = array(430,440,470,435,434,255,198); $t = max(max($d1),max($d2),max($d3)); // $t is 656 The inner max() functions operate on the arrays, the outer max compares the numeric results of the inner ones. http://php.net/manual/en/function.max.php

« previous php.notes (#178091) next »