小白教程
所有教程
关于
Search
108.162.216.90
108.162.216.90
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Func misc connection aborted”的源代码
本页内容
下一节:
Func_misc_connection_status
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:connection_aborted()}}[[Category:PHP 杂项函数参考手册|1]] = PHP connection_aborted() 函数 = [[:Category:PHP 杂项函数参考手册]] 创建一个函数(check_abort()),在客户机终止脚本时写入一条日志消息: <sample title="" desc="" lang="php" hererun="1"> <?php function check_abort() { if (connection_aborted()) error_log ("Script $GLOBALS[SCRIPT_NAME]" . "$GLOBALS[SERVER_NAME] was aborted by the user."); } // Some script to be executed here // Call the check_abort function when the script ends register_shutdown_function("check_abort"); ?> </sample> == 定义和用法 == connection_aborted() 函数检查是否断开客户机。 == 语法 == <pre> connection_aborted() </pre> == 技术细节 == {| class="table table-striped table-hover" | 返回值: | 如果已终止连接则返回 1,否则返回 0。 |- | PHP 版本: | 4+ |} [[:Category:PHP 杂项函数参考手册]]
返回至“
Func misc connection aborted
”。
下一节:
Func_misc_connection_status