T086ѧϰ�� | վ��ѧԺ | �����ĵ� | ���� | Ъ���� | IP��ַ��ѯ | �������� | ���ջ��� | �����ֵ� | ���ù��� | ������Ϣ��ѯ

����flush()��ob_flush()

�� ����ʱ�䣺2010-10-09 | ���壺�� �� С��
[����]flush (PHP 3, PHP 4, PHP 5) flush -- ˢ���������� ˵�� void flush ( void ) ˢ��PHP�����Ļ��壬������PHPִ���ں��������£�CGI ��web�������ȵȣ����ú�������ǰΪֹ�����������������͵��û����������� flush...

flush
(PHP 3, PHP 4, PHP 5)

flush -- ˢ����������
˵��
void flush ( void )


ˢ��PHP�����Ļ��壬������PHPִ���ں��������£�CGI ��web�������ȵȣ����ú�������ǰΪֹ�����������������͵��û�����������

flush() ���������Է��������ͻ����������Ļ���ģʽ����Ӱ�졣���ˣ�����ͬʱʹ�� ob_flush() ��flush() ������ˢ���������塣

����web�������������ر���Win32�µ�web�������������ڷ��ͽ�����������֮ǰ����Ȼ�Ỻ���ű���������ֱ����������Ϊֹ��

��ЩApache��ģ�飬����mod_gzip�������Լ������������棬�⽫����flush()���������Ľ����������������͵��ͻ�����������

����������Ҳ������ʾ֮ǰ���������յ������ݡ����� Netscape ���������ڽ��ܵ����л� html ���ǵĿ�ͷ֮ǰ�������ݣ������ڽ��ܵ� </table> ����֮ǰ��������ʾ������������

һЩ�汾�� Microsoft Internet Explorer ֻ�е����ܵ���256���ֽ��Ժ��ſ�ʼ��ʾ��ҳ�棬���Ա��뷢��һЩ�����Ŀո�������Щ��������ʾҳ�����ݡ�

 

ob_flush
(PHP 4 >= 4.2.0, PHP 5)

ob_flush --  Flush (send) the output buffer
Description
void ob_flush ( void )


This function will send the contents of the output buffer (if any). If you want to further process the buffer's contents you have to call ob_get_contents() before ob_flush() as the buffer contents are discarded after ob_flush() is called.

This function does not destroy the output buffer like ob_end_flush() does.


flush��ob_flush��ʹ������һЩ�ر����׷����ĵط��������޷�ˢ���������塣
һ. flush��ob_flush����ȷ˳������ȷӦ�ǣ���ob_flush��flush�����£�
ob_flush();
flush();
����Web�������IJ���ϵͳ��windowsϵͳ����˳���ߵ����߲�ʹ��ob_flush()Ҳ�����������⡣������Linuxϵͳ�Ͼ��޷�ˢ���������塣

��. ʹ��ob_flush()ǰ��ȷ��ǰ�������ݴ�С�㹻4069�ַ���
һЩWeb��������output_bufferingĬ����4069�ַ����߸��󣬼��������ݱ����ﵽ4069�ַ��������Ż�flushˢ���������壬Ϊ��ȷ��flush��Ч��������ob_flush()����ǰ���������䣺
print str_repeat(" ", 4096);
��ȷ������output_bufferingֵ��


for ($i=10; $i>0; $i--)
{
    echo $i.'<br />';
    ob_flush();
    flush();
    sleep(1);
}
ob_end_flush();

  • ת����ע����Դ��ITѧϰ�� ��ַ��http://www.t086.com/ �����������Ƽ�������
  • �ر������� ��վ�������ر�������ֹת�ص�ר�������������¿�������ת�أ���������ע��������ԭʼ���ߡ����°�Ȩ������ԭʼ�������С����ڱ���վת�����µĸ��˺���վ�����DZ�ʾ������л�⡣������վת�ص������а�Ȩ��������ϵ���ǣ����ǻᾡ�����Ը�����
������ѯ Health Check Gulangyu
© 2017 T086ѧϰ�� - T086.com(ԭitlearner.com)
RunTime:7.89ms QueryTime:7