I have an array like so:
Array
(
[0] => Array
(
[rb_priceRangeId] => 3
[rb_priceRangeMin] => 300000
[rb_priceRangeMax] => 399999
)
[1] => Array
(
[rb_priceRangeId] => 5
[rb_priceRangeMin] => 400000
[rb_priceRangeMax] => 499999
)
)
How would I get the lowest value out rb_priceRangeMin into a variable and get hightest value out of rb_priceRangeMax into a variable? I think I would have to use a foreach, but I have no idea what would go inside it. Any help would be highly appreciated
I have tried
foreach($array as $row => $value){
$min = $value['rb_priceRangeMin'];
if($min < $value['rb_priceRangeMin']){
$min = $value['rb_priceRangeMin'];
}
$max = $value['rb_priceRangeMax'];
if($max < $value['rb_priceRangeMax']){
$max = $value['rb_priceRangeMax'];
}
}