Glad you got it working. Don't forget to mark this as resolved if it is.
BTW, I did it by minutes because that's the least common denominator in your question. You to know if each day (1440 minutes) they have passed the 30 minute threshold. Easiest way to compare is with minutes, since 49 hours and 24 minutes is "within" that threshold of 30 minutes past an hour, but after the 48 so it should be 72 hours.
Here's some example code:
<?php
/* Given:
$diff = Array (
[days] => 2
[hours] => 2
[minutes] => 28
);
*/
if($diff['minutes'] > 30)
$diff['days']++;
// PROBLEM: if hours are > 0, we need to round down, otherwise round up:
if($diff['hours'] != 0 || $diff['minutes'] > 30)
{
$diff['days']++;
}
May be fewer lines of code; however, in my first example, you know precisely how many minutes have passed and since you know that the first 30 minutes will be 30 and the last 30 minutes will be 1410, you can do a simpler "if > 30" rather than a more complicated "if hours not equal to 0 OR minutes > 30".
Either way will work, I prefer to be explicit in my code with what I'm doing since I may need to rework it later (like if they want to add a grace-period of 30 minutes from noon, I don't need to do much other than do 720 minutes + 30 minutes is the max past the start of a day they can go.