ob_get_clean

Supported Versions: PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8
Get the contents of the active output buffer and turn it off
<?php ob_get_clean(): string|false
<?php         $callback();



        return ob_get_clean();

    }



    function getFilenameFromContentDispositionHeader($header)
<?php         ob_start();

        $this->get($photo->temporaryUrl())->sendContent();

        $rawFileContents = ob_get_clean();



        $this->assertEquals($file->get(), $rawFileContents);
<?php         ob_start();

        $response = $this->get($photo->temporaryUrl());

        $response->sendContent();

        $rawFileContents = ob_get_clean();

        $this->assertEquals($file->get(), $rawFileContents);



        ob_start();
<?php         ]);

        $cachedResponse->sendContent();

        $this->assertEquals(304, $cachedResponse->getStatusCode());

        $cachedFileContents = ob_get_clean();



        $this->assertEquals('', $cachedFileContents);

    }
<?php         ob_start();

        $this->get($photo->temporaryUrl())->sendContent();

        $rawFileContents = ob_get_clean();



        $this->assertEquals($file->get(), $rawFileContents);
<?php         ob_start();

        $this->get($photo->temporaryUrl())->sendContent();

        $rawFileContents = ob_get_clean();



        $this->assertEquals($file->get(), $rawFileContents);

    }
<?php         ob_start();

        $this->get($photo->temporaryUrl())->sendContent();

        $rawFileContents = ob_get_clean();



        $this->assertEquals($file->get(), $rawFileContents);

    }
<?php             $this->handleViewException($e, $obLevel);

        }



        return ltrim(ob_get_clean());

    }
<?php             $image = imagecreatetruecolor($width, $height);



            if (! function_exists($functionName = "image{$extension}")) {

                ob_get_clean();



                throw new LogicException("{$functionName} function is not defined and image cannot be generated.");

            }
<?php             call_user_func($functionName, $image);



            fwrite($temp, ob_get_clean());

        });

    }

}
<?php     protected function componentData()

    {

        $defaultSlot = new ComponentSlot(trim(ob_get_clean()));



        $slots = array_merge([

            '__default' => $defaultSlot,
<?php         [$currentName, $currentAttributes] = $currentSlot;



        $this->slots[$this->currentComponent()][$currentName] = new ComponentSlot(

            trim(ob_get_clean()), $currentAttributes

        );

    }
<?php         $last = array_pop($this->fragmentStack);



        $this->fragments[$last] = ob_get_clean();



        return $this->fragments[$last];

    }
<?php         $last = array_pop($this->sectionStack);



        if ($overwrite) {

            $this->sections[$last] = ob_get_clean();

        } else {

            $this->extendSection($last, ob_get_clean());

        }
<?php         if ($overwrite) {

            $this->sections[$last] = ob_get_clean();

        } else {

            $this->extendSection($last, ob_get_clean());

        }



        return $last;