clear output ob php code example Example 1: php clear ob ob_clean(); Example 2: php clear output ob_end_clean();