(PHP 5 >= 5.4.0, PHP 7)
header_register_callback — ����һ�� header ����
ע��һ���������� PHP ��ʼ�������ʱ���á�
PHP ����������Ӧͷ���ڷ�������֮ǰִ�� callback
��������һ��������Ӧͷ�IJ������ڡ�
callback
��ͷ����ǰ���ú����� ��û�в��������ص�ֵҲ�ᱻ���ԡ�
�ɹ�ʱ���� TRUE
�� ������ʧ��ʱ���� FALSE
��
Example #1 header_register_callback() ����
<?php
header('Content-Type: text/plain');
header('X-Test: foo');
function foo() {
foreach (headers_list() as $header) {
if (strpos($header, 'X-Powered-By:') !== false) {
header_remove('X-Powered-By');
}
header_remove('X-Test');
}
}
$result = header_register_callback('foo');
echo "a";
?>
�������̵���������ڣ�
Content-Type: text/plain a
header_register_callback() ����ͷ��������ǰִ�еģ� ���Ա������������������������������̡�
Note:
����ͷֻ����SAPI֧��ʱ�õ�����������