How do I round the result of time() up (towards the future) to the next multiple of 5 minutes?
time()
Try:
$time = round(time() / 300) * 300;