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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -