ob_get_level
Description
The ob_get_level of Output Control for PHP return the nesting level of the output buffering mechanism.
Syntax
ob_get_level(): int
Return
Returns the level of nested output buffering handlers or zero if output buffering is not active.
Examples
1 · output_buffering
<? $return = ob_get_level(); echo $return;
1
2 · ob_start · 1
<? ob_start(); $return = ob_get_level(); echo $return;
2
3 · ob_start · 2
<? ob_start(); ob_start(); $return = ob_get_level(); echo $return;
3