M
M
maiskiykot2018-04-19 11:13:32
PHP
maiskiykot, 2018-04-19 11:13:32

What is the best way to compare PHP dates?

I have an array of dates.

Array
(
    [0] => 19.09.2016

    [1] => 24.03.2017

    [2] => 02.05.2017

    [3] => 19.06.2017

    [4] => 18.09.2017

    [5] => 30.10.2017

    [6] => 18.12.2017

)

When comparing dates from an array with a certain date greater than any array value, the same error occurs - one date remains outside the sample. Those. :
$data = 03/02/2017;
strtotime($data) < strtotime(Array[1]) although the selection must capture Array[0] as well. Of course, the crutch with the addition of Array[0] did, but I would like to understand the reason for the date not being included in the selection.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question