PHP program to find the minimum number among a list?

1 answer

Answer

1108005

2026-07-11 23:05

+ Follow


// Declare array of numbers.
$list = array( 2, 8, 14, -1, 17, 99 );

// Sort items in ascending order.
sort( $list );

// Output the first (which is least) item.
// Note: if the array is empty, this will issue E_NOTICE.
echo 'The least number is ' . $list[ 0 ];

?>

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.