public function sseMessageLine($text, $id = null)
    {
        if (!is_null($id)) {
            echo "id: $id\n";
        }

        $text = explode("\n", $text);
        $text = 'data: '.implode("\ndata: ", $text)."\n\n";
        echo $text;
        flush();
    }
public function sseMessageLine($text, $id = null)
    {
        if (!is_null($id)) {
            echo "id: $id\n";
        }

        $text = explode("\n", $text);
        $text = 'data: '.implode("\ndata: ", $text)."\n\n";
        echo $text;
        flush();
    }
public function sseMessageLine ( $ text , $ id = null ) { if ( ! is_null ( $ id ) ) { echo "id: $id\n" ; } $ text = explode ( "\n" , $ text ) ; $ text = 'data: ' . implode ( "\ndata: " , $ text ) . "\n\n" ; echo $ text ; flush ( ) ; }
Sends text through SSE channel. Text may contain newlines
which will be transmitted proprely. Optionally you can
specify ID also.
Sends text through SSE channel . Text may contain newlines which will be transmitted proprely . Optionally you can specify ID also .