echo "Running detailedHistory\r\n"; $history = $pubnub->detailedHistory(array('channel' => $channel, 'count' => 5, 'end' => "13466530169226760")); print_r($history); echo "\r\n"; ## --------------------------------------------------------------------------- ## History Example ## --------------------------------------------------------------------------- echo "Running history\r\n"; $history = $pubnub->history(array('channel' => $channel, 'limit' => 2)); echo $history; echo "\r\n"; ## --------------------------------------------------------------------------- ## Here_Now Example ## --------------------------------------------------------------------------- echo "Running here_now\r\n"; $here_now = $pubnub->here_now(array('channel' => $channel)); var_dump($here_now); echo "\r\n"; ## --------------------------------------------------------------------------- ## Timestamp Example ## --------------------------------------------------------------------------- echo "Running timestamp\r\n"; $timestamp = $pubnub->time(); echo 'Timestamp: ' . $timestamp; echo "\r\n"; ## --------------------------------------------------------------------------- ## Presence Example ## --------------------------------------------------------------------------- //echo("\nWaiting for Presence message... Hit CTRL+C to finish.\n"); // //$pubnub->presence(array(
<?php require_once 'Pubnub.php'; $pubnub = new Pubnub('demo', 'demo', false, false, false); $here = $pubnub->here_now(array('channel' => 'my_channel')); $occupancy = $here['occupancy']; $user_ids = $here['uuids']; print "UUIDs (userIDs): "; print_r($user_ids); print "\n"; print "OCCUPANTS: {$occupancy}\n\n";