I have an array which I am getting from an API call. The array looks like this :
[3] => Array
(
[project_id] => project:eead2382e9d679814c13c77ab857ae53
[start_date] => 2017-01-16
[end_date] => 2019-11-15
)
[4] => Array
(
[project_id] => project:096b2fc2bc5133784c13c77ab857ae53
[start_date] => 2017-03-08
[end_date] => 2017-06-30
)
I am looping through all my results and checking if the end_date value equals today or if it is greater than today. Like this :
$today = date("Y-m-d");
$qualified = [];
foreach($results as $result) {
if($result['end_date'] > $today){
array_push($qualified, $result);
}
}
echo '<pre>';
print_r($qualified);
echo $today;
Yet i get an empty array eventho there are values greater than today. Am I doing something wrong?