phil has a blog - Keep a PHP script running in the background after the page has stopped or closed

Keep a PHP script running in the background after the page has stopped or closed

Useful if allowing a cron to be run from a website

<?php
ignore_user_abort(TRUE); // run script in background
set_time_limit(0); // no time limit

// code...

// ?>