3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $rows = array( "collect_date" => "2014-07-14", "status" => 4 ); $date=date("d/m/Y", strtotime($rows['collect_date'])); if ($date==date(("d/m/Y"), strtotime('+1 days')) && $rows['status']=='4') { echo "<span class='label label-danger1'>".$date."</span>"; } elseif ($date==date(("d/m/Y")) && $rows['status']=='4') { echo "<span class='label label-danger'>".$date."</span>"; } elseif ($date==date(("d/m/Y"), strtotime('+2 days')) && $rows['status']=='4') { echo "<span class='label label-warning'>".$date."</span>"; } elseif (strtotime($date) < strtotime('1 day ago') && $rows['status']=='4') { echo "<span class='label label-danger'>".$date."</span>"; } else { echo $date; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<span class='label label-danger'>14/07/2014</span>