Skip to content

Instantly share code, notes, and snippets.

View anovikov1984's full-sized avatar

anovikov1984

  • Limassol, Cyprus
  • 13:14 (UTC +03:00)
View GitHub Profile
@anovikov1984
anovikov1984 / pubnub_rts_fetching_vars.php
Created November 9, 2015 17:02
Fetching environment variables and generating a JSON response using them
<?php
header('Content-Type: application/json');
$publishKey = trim(getenv("PUBNUB_PUBLISH_KEY"));
$subscribeKey = trim(getenv("PUBNUB_SUBLISH_KEY"));
if (empty($publishKey)) {
$publishKey = "demo";
}