ob_flush

Supported Versions: PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8
Flush (send) the return value of the active output handler
<?php ob_flush(): bool
<?php         echo json_encode(['stream' => true, 'body' => $body, 'endStream' => true]);



        if (ob_get_level() > 0) {

            ob_flush();

        }



        flush();