Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php get highest value in multidimensional array

<?php 
 
//get the highest value from multi dimenstion array in php
$array = [[100, 200, 600],[205, 108, 849, 456],[548, 149, 784]];
$max = 0;
foreach ($array as $val)
{
    foreach($val as $key=>$val1)
    {
        if ($val1 > $max)
        {
        $max = $val1;
        }
    }       
}
print ($max);
?>
Comment

PREVIOUS NEXT
Code Example
Php :: $ whereis php terminal mac 
Php :: php last of string till / 
Php :: php find in array 
Php :: laravel test filter 
Php :: php xpath attribute exact 
Php :: laravel eloquent update quantity 
Php :: pagination using ajax 
Php :: Laravel 9 Multiple File Upload Tutorial 
Php :: shortcode wordpress form 
Php :: php response image 
Php :: laravel 6 use username instead of id 
Php :: PHP OOP - Inheritance 
Php :: echo require php 
Php :: avatar generator laravel 
Php :: laravel vue pagination with search filter 
Php :: multiline string php 
Php :: what is Trustproxies handle in laravel 
Php :: magento Fatal error: Allowed memory size of 134217728 bytes exhausted 
Php :: sweet alert confirm box laravel 
Php :: displaying variables in blade laravel 
Php :: laravel project composer [ErrorException] Undefined index: name 
Php :: Best testing tools for php 
Php :: add data to the collection laravel 
Php :: php mysql 
Php :: laravel property 
Php :: image laravel 
Php :: PHP Custom Time Ago Function 
Php :: findOneBy 
Php :: export laravel path fedora 
Php :: best wordpress functions to include 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =