Test.php 697 字节
<?php

namespace Controller;

use Lib\Mail\MailFun;
use Model\emailSql;
use Model\listsSql;

/**
 * @author:dc
 * @time 2023/2/13 11:28
 * Class Home
 * @package Controller
 */
class Test {


    public function home(){
        ob_start();
        header("Content-Type:text/event-stream;Charset=UTF-8;\n\n");
        header("cache-control:no-cache;\n\n");


        foreach (range(1,10) as $i)

        {

            echo $i.'hello world'.PHP_EOL.PHP_EOL ;

            ob_flush();

            flush();


            sleep(1);

        }

        ob_clean();
    }

    public function a(){
        header("Content-Type:text/html;Charset=UTF-8;");
        echo '1';
    }





}