Search
 
SCRIPT & CODE EXAMPLE
 

PHP

program logic for second largest number in an array in php

function secondHighest(array $arr) {
    
    sort($arr);
    
    echo $arr[sizeof($arr)-2];
}
 
 
secondHighest(array( 4, 9, 5, 2, 8, 0, 3, 22));
Comment

PREVIOUS NEXT
Code Example
Php :: php artisan tinker PsyExceptionRuntimeException Unable to create PsySH runtime directory 
Php :: php select option selected from database 
Php :: The configuration file now needs a secret passphrase (blowfish_secret). 
Php :: laravel eloquent mass update 
Php :: how to add php file in html 
Php :: php unique id 
Php :: ile_put_contents(/opt/bitnami/apache2/htdocs/bootstrap/cache/services.php): failed to open stream: Permission denied 
Php :: php curl Content-Length 
Php :: check if the request is ajax request in laravel 
Php :: how make custom menu in wordpress 
Php :: laravel redirect to controller method 
Php :: laravel 6 orderby 
Php :: str_ireplace 
Php :: laravel append 
Php :: Displaying the category name of a custom post type 
Php :: how to create migration in laravel 
Php :: laravel eloquent without relation 
Php :: generate slug on create laravel 
Php :: PHP Time Limit: 
Php :: blade if array key exists 
Php :: php time to date 
Php :: php query pdo 
Php :: laravel 8 eloquent orderby 
Php :: laravel find by field 
Php :: unique check with multiple columns laravel validation 
Php :: or where in codeigniter 
Php :: compare dates datetime php 
Php :: instal phpgd2 
Php :: laravel cache put array 
Php :: call to a member function setcookie() on null laravel middleware 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =