<?php
/**
* @param $t UNIX timestamp
* @return true iff the given time fell in the previous Sunday->Sunday window
*/
function f($t) {
$a = strtotime("last Sunday");
$b = strtotime("-1 week", $a);
return ($b <= $t && $t < $a);
}
var_dump(f(strtotime("2011-08-12 11:00")));
var_dump(f(strtotime("2011-08-08 11:00")));
var_dump(f(strtotime("2011-08-04 11:00")));
var_dump(f(strtotime("2011-08-01 11:00")));
?>