PHP 플러시() 함수
예시
스크립트 실행이 완료되기 전에 브라우저에 문자열을 출력합니다.
<?php
// Some browsers will not display the content if it is too short
// We use str_pad() to make the output long enough
echo str_pad("Hello
World!", 4096);
// Use flush() to send the string to the browser
flush();
// Display the rest of the content three seconds later
sleep(3);
echo "<br>";
echo "Hello World!";
?>
정의 및 사용
이 flush()
함수는 현재 버퍼링된 출력을 브라우저로 보내도록 서버에 요청합니다. 서버 구성이 항상 이를 허용하는 것은 아닙니다.
통사론
flush();
기술적 세부 사항
PHP 버전: | 4+ |
---|
❮ PHP 출력 제어 기능