I need to iterate some code in a bidimensional array. In my form there is an input textbox where user insert a date
the array $myArray is
Array
(
[range1] => Array
(
[From] => 01/07/2002
[To] => 31/12/2002
[Rate] => 10.35
)
[range2] => Array
(
[From] => 01/01/2003
[To] => 30/06/2003
[Rate] => 9.85
)
[range3] => Array
(
[From] => 01/07/2003
[To] => 31/12/2003
[Rate] => 9.1
)
.
.
.
.
[range24] => Array
(
[From] => 01/01/2014
[To] => 30/06/2014
[Rate] => 8.25
)
)
I want to check in each range (from range1 to range24) if the date inserted by the user is less than [From] or grather than [To] or fall in the range. Something like:
if ($dateInserted >= $myArray[range1][From]) {
...do something...
} elseif ($dateInserted < $myArray[range1][To]) {
...do something...
} else {
...do something...
}
and so on foreach range
Thanks in advance