PHP file that should run once and delete itself. Is it possible?
Here's a great way of ensuring the script gets deleted, no matter if intervening code calls exit() or not.
class DeleteOnExit
{
function __destruct()
{
unlink(__FILE__);
}
}
$g_delete_on_exit = new DeleteOnExit();
<?php unlink(__FILE__); ?>