I have the following array:
Array
(
[0] => 124,95
[1] => 139,95
[2] => 149,95
[3] => 1200
[4] => 150
[5] => 154,95
[6] => 130
[7] => 189,95
[8] => 199,95
[9] => 30
[10] => 150
)
And I am trying to get the lowest (30) and highest (1200) numbers from it.
So I did this:
while($getpricesproducts = $getpricesproductscon->fetch_assoc()){
$prijsarray[] = $getpricesproducts['prijs'];
}
// Lowest and highest price to put in price slider
$prijslow = min($prijsarray);
$prijshigh = max($prijsarray);
echo $prijslow;
echo $prijshigh;
$prijsarray
is above array.
But the echoed values are 30 as min number and 150 as max. Why is that? Does it have something to do with the commas in some numbers? Still it is weird that 1200 is not the max number since it does not have any commas.