Which PHP script finds the earliest and latest dates from an array?

Here is the answer of the question: Which PHP script finds the earliest and latest dates from an array?

  • <?php
    $dates = array(‘2018-02-01’, ‘2017-02-02’, ‘2015-02-03’);
    echo “Latest Date: “. max($dates).”\n”;
    echo “Earliest Date: “. min($dates).”\n”;
    ?>
  • <?php
    $dates = array(‘2018-02-01’, ‘2017-02-02’, ‘2015-02-03’);
    echo “Latest Date: “. min($dates).”\n”;
    echo “Earliest Date: “. max($dates).”\n”;
    ?>
  • <?php
    $dates = array(‘2018-02-01’, ‘2017-02-02’, ‘2015-02-03’);
    echo “Latest Date: “. ($dates).”\n”;
    echo “Earliest Date: “. ($dates).”\n”;
    ?>
  • <?php
    $dates = array(‘2018-02-01’, ‘2017-02-02’, ‘2015-02-03’);
    echo “Latest Date: ” max($dates).”\n”;
    echo “Earliest Date: ” min($dates).”\n”;
    ?>

The above question is related to “LinkedIn PHP Skill Quiz“. You can find all the updated questions and answers related to to “LinkedIn PHP Skill Quiz” on the “LinkedIn PHP Skill Quiz” page. If you find the update in question or answers, do comment on this page and let us know. We will update the answers as soon as possible.

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment

Share via
G Certification Course We would like to show you notifications for the latest news and updates.
Dismiss
Allow Notifications
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend