title: A server-bound counter in PHP that would reset to zero every midnight or at least would seem so
body: <p>I'd like to know the best way to implement in PHP a counter that, having been incremented by some events on the server during a day, would be reset to zero with a new day coming, i.e at midnight. Probably comparing the date associated with the last value of the counter with the current date would make it reset?</p>
  
  <p>EDIT: What if the counter gets reset the moment when it's going to be incremented provided that the code somehow figures out that the last time the counter was incremented was yesterday or a day earlier? It would be good enough.</p>