Hi
I know this should be simple, but I can't figure this one out correctly. I need to filter a multidimentional array on a date. Actually I need to filter on year only, but I thought I'd try with a date first.
Array
(
[0] => Array
(
[0] => 2012-10-26
[1] => 500
)
[1] => Array
(
[0] => 2012-10-25
[1] => 500
)
[2] => Array
(
[0] => 2012-10-26
[1] => 500
)
)
Is the array example. I've tried
foreach($revenueArray as $key => $row) {
if( $row[0]=='2012-10-25' ):
unset($revenueArray[$key]);
endif;
}
The strange part is, if I try to filter on the other value:
if( $row[1]==500 ):
unset($revenueArray[$key]);
endif;
then it works fine, so must be something about the date
But still no cigar
If anybody know how, I'd appreciate the help.
Edit: strange part is, if I do a :
if (is_string($row[0])){ echo "yes it's a string"; }
Then it returns the echo, so why can't I compare a string to a string in [0] when I can in [1] ?
Thanks