ob_get_clean
(PHP 4 >= 4.3.0, PHP 5)
ob_get_clean — 현재 버퍼 내용을 얻은 뒤에 현재 출력 버퍼를 지웁니다.
설명
string ob_get_clean
( void
)
출력 버퍼의 내용을 반환하고 출력 버퍼링을 종료합니다. 출력 버퍼링이 존재하지 않으면 FALSE를 반환합니다. ob_get_clean()은 ob_get_contents()와 ob_end_clean()을 실행한 것과 동일합니다.
Example#1 간단한 ob_get_clean() 예제
<?php
ob_start();
echo "Hello World";
$out = ob_get_clean();
$out = strtolower($out);
var_dump($out);
?>
이 예제의 출력은:
string(11) "hello world"
참고: ob_start(), ob_get_contents().