php - Find Array value ranges max and min value -


here array how can find minimum , maximum value. i.e,

output must min=0;max=15   array ( [0] => 5-10 [1] => 10-15 [2] => 0-2 [3] => 15 ) 

<?php  $price_range=array("0-2","2-5","5-10","10-15","15"); foreach($price_range $key=>$value){ $a=explode('-',$value); if($a[0] != ''){$b[]= $a[0];} if($a[1] != ''){$b[]= $a[1];} } echo 'min: '.$min=min($b); echo 'max: '.$max=max($b); ?> 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -