jpadie - thanks!
For some reason, my include_once "daysago.php" file,
(the name I called your script),
php had trouble finding - even though it resides
in the same directory with my other include_once script "config.php". (see error below).
This forced me to use your code inline.
Then it worked just right.
Might you know why the included file couldn't be found?
When I invoked your script with:
$p5 = getdaysago($p5);
The error was:
function getdaysago($date) { $then = strtotime($date); $diff = time() - $then; $days = floor($diff/(60*60*24)); return $days; }
Fatal error: Call to undefined function getdaysago() in /Applications/MAMP/htdocs/phpQuery_test2/indexHPP.php on line 50