function fun(){
fopen('./为什么又是放两天假呢.txt', 'a+');
}
ignore_user_abort(false);
register_shutdown_function('fun', '');
sleep(5);问题1:
ignore_user_abort 的参数无论是true或者false到最好都会创建那个txt文件问题2:
创建的文件并没有在我想要的目录下,而是在apache根目录下
哪位帮忙解释下?
fopen('./为什么又是放两天假呢.txt', 'a+');
}
ignore_user_abort(false);
register_shutdown_function('fun', '');
sleep(5);问题1:
ignore_user_abort 的参数无论是true或者false到最好都会创建那个txt文件问题2:
创建的文件并没有在我想要的目录下,而是在apache根目录下
哪位帮忙解释下?
问题2 不熟悉apache 请无视我
1、register_shutdown_function: Registers the function named by function to be executed when script processing is complete.
2、Note: Working directory of the script can change inside the shutdown function under some web servers, e.g. Apache.
register_shutdown_function 是注册一个当程序结束时必须执行的函数对于你的代码,只要程序结束了就会创建那个txt文件
至于是程序自然结束还是客户端断开而结束或者是因其他原因结束(比如超时),你的程序并没有做出相应的动作。