Answer the question
In order to leave comments, you need to log in
How to write data for each day in statistics - duplicate or skip?
Statistics are written for each day.
Structure:
date | type | num
2020-04-06 | rating | 384
SELECT *
FROM `site_statistics`
WHERE type = 'rating'
AND date = '2020-04-06'
Answer the question
In order to leave comments, you need to log in
We get the element with the key $a from the array, put it in the output array.
We add to the output array all elements of the original array whose key does not match $a.
usort
In the callback, we simply compare the element with the desired value
if yesterday it was 27 degrees and today it's 27, maybe meteorologists shouldn't record the temperature every day?
It is natural to write if these parameters relate to logging and building any statistics, and this does not apply to DRY in any way.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question