I have an array
where each record has a 'date'
field. The dates are in this format: '10/09/2015'
. When I use strtotime
on these dates, some of them come out as false
. I thought there was a mistake in data structure so I created this simple array
and a simple foreach
loop, and they output false
in some cases. What does it not like?
$dates = [];
$someData = [
'21/05/2014',
'22/05/2014',
'09/06/2014',
'04/07/2014',
];
foreach($someData as $date) {
$dates[] = strtotime($date);
}
print_r($dates);die;