My case is i have price of an item in a range of Kilogram, like
price in range 0.01-0.04 is 5
price in range 0.05-0.09 is 30
price in range 0.1-0.15 is 50
Here is sample of array like i want
$prices = array("0.01-0.04"=>5,"0.05-0.09"=>30);
now i want to make an array so when user input 0.02 it should return price in range 0.01-0.04 which is 5, similarly if user input 0.07 so it should return 30.
how to make an array in PHP to access array via a range of indexes?