title: GCM plain text Push notification in PHP?
body: <p>I am new In android and PHP. I am working on push Notification.
  I have read many tutorials but all are for Json not for plain text.
  For json code is here , but I want to send only plain text.
  I have read this .</p>
  
  <p><a href="https://github.com/mattg888/GCM-PHP-Server-Push-Message/blob/master/GCMPushMessage.php" rel="nofollow noreferrer">https://github.com/mattg888/GCM-PHP-Server-Push-Message/blob/master/GCMPushMessage.php</a></p>
  
  <p><a href="http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/" rel="nofollow noreferrer">http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/</a></p>
  
  <p>I have also read this .
  <a href="https://stackoverflow.com/questions/22486192/gcm-error-missingregistration-sending-messages-via-json">GCM Error=MissingRegistration sending messages via JSON</a></p>
  
  <p>My code is here ,can some body help me in this</p>
  
  <pre><code>   &lt;?php
  
  $gcm_regid = 'fkjfsdhfsuvgsdhfkfkjshdfuwfsdfh9wfjehf9ufwjfhu9erfjkhf9efiefhwodfh9'; // GCM Registration ID
  $registatoin_ids = array($gcm_regid);
  $message = array("message" =&gt; "Hello test");
  
  
  // Set POST variables
      $url = 'https://android.googleapis.com/gcm/send';
  
      $fields = array(
          'registration_ids' =&gt; $gcm_regid,
          'data' =&gt; 'helloword',
      );
  
      $headers = array(
          'Authorization: key=12dsdsvefdfdfgdfgdfgdfgfgfgfg',
          'Content-Type: application/x-www-form-urlencoded'
      );
      // Open connection
      $ch = curl_init();
  
      // Set the url, number of POST vars, POST data
      curl_setopt($ch, CURLOPT_URL, $url);
  
      curl_setopt($ch, CURLOPT_POST, true);
      curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
      // Disabling SSL Certificate support temporarly
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  
      curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
  
      // Execute post
      $result = curl_exec($ch);
      if ($result === FALSE) {
          die('Curl failed: ' . curl_error($ch));
      }
  
      // Close connection
      curl_close($ch);
      echo $result;
  
    ?&gt;
  </code></pre>