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

        $text = 'data: '.json_encode($text)."\n\n";
        $this->_out_encoding = false;
        echo $text;
        flush();
        $this->_out_encoding = true;
    }
public function sseMessageJSON($text, $id = null)
    {
        if (!is_null($id)) {
            echo "id: $id\n";
        }

        $text = 'data: '.json_encode($text)."\n\n";
        $this->_out_encoding = false;
        echo $text;
        flush();
        $this->_out_encoding = true;
    }
public function sseMessageJSON ( $ text , $ id = null ) { if ( ! is_null ( $ id ) ) { echo "id: $id\n" ; } $ text = 'data: ' . json_encode ( $ text ) . "\n\n" ; $ this -> _out_encoding = false ; echo $ text ; flush ( ) ; $ this -> _out_encoding = true ; }
Sends text or structured data through SSE channel encoded
in JSON format. You may supply id argument.
Sends text or structured data through SSE channel encoded in JSON format . You may supply id argument .