Home > php教程 > php手册 > php 刷新输出缓冲代码

php 刷新输出缓冲代码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-25 16:42:30
Original
2069 people have browsed it

<?php
function throw_error($message) {
    $error_page = "/err/error.php";
    $error_url = $error_page;
    $error_url.= "?REDIRECT_ERROR_NOTES=$message";
    $error_url.= "&REDIRECT_URL=" . $GLOBALS["PHP_SELF"];
    $error_url.= "&REDIRECT_REQUEST_METHOD=$REQUEST_METHOD";
    $error_url.= "&REDIRECT_STATUS=501";
    Header("Status: 501");
    Header("Location: $error_url");
    exit;
}
ob_start();
// 使用输出缓冲以便在这页中的任何地方输出错误
if (!condition) {
    throw_error("the condition failed");
}
ob_end_flush();
// 页面处理完毕,刷新输出缓冲
Copy after login


教程链接:

随意转载~但请保留教程地址★

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template