Q:

Find earliest and latest dates from a list of dates

0

Find earliest and latest dates from a list of dates.

Pictorial Presentation:

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$dates = array('2015-02-01', '2015-02-02', '2015-02-03');
echo "Latest Date: ". max($dates)."\n";
echo "Earliest Date: ". min($dates)."\n";
?>

Sample Output:

Latest Date: 2015-02-03                                     
Earliest Date: 2015-02-01

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now