常用工具: 简繁转换 HTML/JS互转 Url编码Escape解析 Unicode编码转换 设为首页 加入收藏夹
更多内容
" id="arctext" class="center" " class="arcinfo center" " id="slistl" class="left" " id="mid_slistl_sch" class="left" " id="mid_slistl_adv" class="left" " id="mid_slistl_adv2" " src="http://www.fzs8.net/d/js/acmsd/middle2.js"
文章正文

ASP Hex 函数

来源:  网络收集  字体:[ ]
站内搜索系统
文章正文

php headers_sent() 函数

来源:  网络收集  2006-10-08 00:00:00 字体:[ ]

Definition and Usage
定义和用法

The headers_sent() function checks if / where the HTTP headers have been sent.
headers_sent()函数的作用是:检查标头是否已被发送以及在哪里被发送。

This function returns TRUE if headers has been sent or FALSE if not.
如果header被发送,那么该函数返回True;如果没有发送,则返回False。

Syntax
语法

headers_sent(file,line)

Parameter参数 Description描述
file,line Optional. If the file and line parameters are set, headers_sent() will put the PHP source file name and line number where output started in the file and line variables
可选参数。如果这个文件的行参数[line parameter]已经被设置,那么headers_sent()函数将把PHP源文件名和行数(这里的行数是指结果输出开始的那一行)输入文件以及行变量中。


Tips and Notes
注意点

Note: You can't add more header lines using header() once the header block has already been sent.
注意:当header块[header block]准备发送之前,你不可以使用header()一次性添加多个header。

Note:
The optional file and line parameters where added in PHP 4.3.
注意:这个“选择执行文件”[optional file]和行参数[line parameter]仅在PHP4.3以上版本中获得支持。


Example 1
案例1

<?php// If no headers are sent, send oneif (!headers_sent())  {  header("Location: http://www.w3schools.com/");  exit;  }?>
<html><body>
......


Example 2
案例2

Using the optional file and line parameters:
使用可选文件和行参数的案例:

<?php// $file and $line are passed in for later use// Do not assign them values beforehandif (!headers_sent($file, $line))  {  header("Location: http://www.w3schools.com/");  exit;  // Trigger an error here  }else  {  echo "Headers sent in $file on line $line";  exit;  }?>
<html><body>
......


  
上一篇:php headers_list() 函数
下一篇:php setcookie() 函数
最新文章
推荐文章
热门文章
版权所有:IT加油站   COPYRIGHT © 2007 WWW.FZS8.NET ALL RIGHTS RESERVED.
闽ICP备08008535号