Sounds like you would need to do a cron job or schedule your OS to automatically run a script to reset the variable. You could put
$mode = $_GET['mode'];
at the top of your page and then have:
if ($mode == "resetvar") $var = 0;
Then again it could always be a security issue depending on your use. The URL would be something like "file.php?mode=resetvar".