PHP code example of obsh / sse-client
1. Go to this page and download the library: Download obsh/sse-client library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
obsh / sse-client example snippets
$client = new SseClient\Client('https://eventsource.firebaseio-demo.com/.json');
// returns generator
$events = $client->getEvents();
// blocks until new event arrive
foreach ($events as $event) {
print_r($event);
}