title: Pubnub PHP SDK subscribe function
body: <p>I'm working on a chat application using PubNub and PHP. The publishing of messages is working but I'm not sure how to read from the subscriber.</p>
  <p>I ran the subscriber file in the command line and it is showing the messages as they are published but I'm not sure how to read from it or how to return, as per the doc the subscriber is a separate process.</p>
  <pre><code>use PubNub\PNConfiguration;
  
  class MySubscribeCallback extends SubscribeCallback {
      function status($pubnub, $status) {
          if ($status-&gt;getCategory() === PNStatusCategory::PNUnexpectedDisconnectCategory) {
              // This event happens when radio / connectivity is lost
          } else if ($status-&gt;getCategory() === PNStatusCategory::PNConnectedCategory) {
  
          } else if ($status-&gt;getCategory() === PNStatusCategory::PNDecryptionErrorCategory) {
              // Handle message decryption error. Probably client configured to
              // encrypt messages and on live data feed it received plain text.
          }
      } 
  
      function message($pubnub, $message) {
          print_r($pubnub);
          print_r($message);
      }
  
      function presence($pubnub, $presence) {
          // handle incoming presence data
      }
  }
  
  $subscribeCallback = new MySubscribeCallback();
  
  $pubnub-&gt;addListener($subscribeCallback);
  $pubnub-&gt;subscribe()
             -&gt;channels([&quot;Channel-1&quot;,&quot;Channel-2&quot;,&quot;Channel-3&quot;])
             -&gt;execute();
  </code></pre>
  <p>this is the subscriber code present on the PubNub Doc.
  I'm calling this file using javascript.</p>