i have and amount to compare with the prices in the array and bring one id result.
let say the amount is 113, in this case a need to pick id 31 as result because i have to take the one closer but the biggest one or the exact one in case be like 110 or 115 using php 5.3 to 7.1
$prices = array(
array('id' => '28','price' =>100 ),
array('id' => '29','price' =>105 ),
array('id' => '30','price' =>110 ),
array('id' => '31','price' =>115 ),
array('id' => '32','price' =>120 ),
array('id' => '33','price' =>125 ),
array('id' => '34','price' =>130 )
);
i search on internet i try some array function. i found this article here, but does not meet my need. text