Search code examples
phpdynamic-data

PHP script that reports progress to Client


I'm writing a PHP script that does a lot of repetitive work, and when the client executes it, I'd like it to send back HTML in some way, dynamically, as it completes tasks. (without AJAX?) How can this be done?


Solution

  • You can flush the output buffer, using flush();

    So something like:

    taskOne();
    echo 'Task one finished';
    flush();
    ...
    

    Hope this helps.