UCE Docs / ob_get_close

Signature

String ob_get_close()

Parameters

return value : the current buffer's contents

Returns the current output buffer's contents and discards the buffer, switching back to the previous one on the stack. This is the usual way to capture rendered output for post-processing.

Example

ob_start();
print("hello ");
print("world");
String html = ob_get_close();
print("captured ", html.length(), " chars: ", html, "\n");
Output
captured 11 chars: hello world