19c04-1.php

来自「介绍PHP5的给类型函数应用」· PHP 代码 · 共 27 行

PHP
27
字号
<?php// Create a global variable that keeps the good/bad status of this script// Preset it to 'false'.  Assume the worst case unless we say otherwise.$status = false;// Now create a shutdown function that just outputs a simple status messagefunction my_shutdown() {	// Output either OK or ERROR, depending upon the status	echo $GLOBALS['status'] ? 'OK' : 'ERROR';}// Register this as a shutdown function:register_shutdown_function('my_shutdown');// Now that we are completely setup, also ensure no errors are displayedini_set('display_errors', false);// Let's attempt to save any data sent to us to a file:if (!(file_put_contents('saved.txt', serialize($_REQUEST)))) {	// We had an error, just exit	exit();}// If we made it here, we are done, just set the status to true, meaning we// are exiting cleanly.$status = true;?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?