PHP Find date nearest to a timeline period
问题 So, uh, ok. This might get mathematical, so hope you brought your scientific calculator with you ;) This is my problem: Given an initial date (timestamp), time period period (seconds) and today's date (timestamp), I need to find the nearest date which coincides with the period*n plus the original/initial date. So far, I got some stuff working nicely, such as the amount of "periods" between the initial and final(today's) date, which would be "2" in the demo above: $initial=strtotime('2 April