I have dates array like this
$dates = array('2012-10-02','2012-10-03','2012-10-07', '2012-10-20');
Now if I have a current_date say
$current_date = '2010-10-11';
how would I find whats the closest PAST date to this. Which in this case would be 2012-10-07
thanks
Try like this
For Future Date: