Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php find lowest value in associative array

<?php

$a = [
	['emp_id' => '1', 'name' => 'ram', 'age' => 40],
	['emp_id' => '5', 'name' => 'ram_1', 'age' => 20],
	['emp_id' => '2', 'name' => 'ram_2', 'age' => 30],
	['emp_id' => '3', 'name' => 'ram_4', 'age' => 25],
	['emp_id' => '4', 'name' => 'ram_3', 'age' => 50]

];
// please find minimum age employee in above array.

$ageArray = array_column($a, 'age');
echo min($ageArray);
 
PREVIOUS NEXT
Tagged: #php #find #lowest #associative #array
ADD COMMENT
Topic
Name
4+7 =