I'v got this array:
$by_date = array(
"2018-10-05"=>54,
"2018-10-07"=>20,
"2018-10-08"=>31,
"2018-10-12"=>52
);
I want to get value by date, but if the date doesn't exist get the lowest date value
for example:
if the date is "2018-10-07
" I'll get 20
and if the date is "2018-10-10
" I'll get 31
that can go to bigger differences between the date and the last key in the array
For example, if the date is "2019-01-25
" I'll get 52 because "2018-10-12
" is the last key in the array.
Thanks for the help :)