about 9 years ago
Hello Reader! If you having an multidiamensnal array and you want to get the max value from a single element key then you see the example below:-
[0] => stdClass Object ( [id] => TRF1254 [cust] => CUST9897 [amount] => 8974 [balance] => Array ( [0] => 8987 ) ) [1] => stdClass Object ( [id] => TRF1254 [cust] => CUST9896 [amount] => 589 [balance] => Array ( [0] => 8974 ) ) [2] => stdClass Object ( [id] => TRF1259 [cust] => CUST9659 [amount] => 1258 [balance] => Array ( [0] =>365 ) )
code for sorting:-
$numbers = array(); foreach($array as $obj) { $numbers[] = $obj->amount; } $max = max($numbers);
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)