ob_get_contents

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return the contents of the output buffer
<?php ob_get_contents(): string|false
<?php         include __DIR__."/../../resources/views/components/$view.php";



        return tap(ob_get_contents(), function () {

            ob_end_clean();

        });

    }
<?php         ob_start();

        eval(Str::of($this->compiler->compileString($blade))->remove(['<?php', '?>']));

        $output = ob_get_contents();

        ob_end_clean();



        $this->assertSame($expectedOutput, $output);
<?php         ob_start();

        eval(Str::of($this->compiler->compileString($blade))->remove(['<?php', '?>']));

        $output = ob_get_contents();

        ob_end_clean();



        $this->assertSame($expectedOutput, $output);