Skip to content

Instantly share code, notes, and snippets.

@hxmwr
Last active June 4, 2017 13:27
Show Gist options
  • Save hxmwr/7404d166296b4a26da7026d3a18f71de to your computer and use it in GitHub Desktop.
Save hxmwr/7404d166296b4a26da7026d3a18f71de to your computer and use it in GitHub Desktop.
php 脚本返回后继续运行
ignore_user_abort(true);
set_time_limit(0);
ob_start();
// do initial processing here
echo $response; // send the response
header('Connection: close');
header('Content-Length: '.ob_get_length());
ob_end_flush();
ob_flush();
flush();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment