Skip to content

Instantly share code, notes, and snippets.

@raviy1290
raviy1290 / gist:6c9b0f46cde8e967af97be08e8586f21
Created June 13, 2017 15:34
Sending GCM notification easily in PHP
function send_gcm_notification($registatoin_ids, $title=null, $description=null){
$GOOGLE_API_KEY = 'AIzaZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ';
// Set POST variables
$url = 'https://android.googleapis.com/gcm/send';
$post_data = array();
$post_data['to']=$registatoin_ids;
$post_data['notification']=array('body'=>'your body', 'title'=>'your title');
$post_data['data']=array('body'=>array('title'=>$title, 'description'=>$description));
@raviy1290
raviy1290 / Security.php
Created October 30, 2013 11:23
codeigniter hack: when on CSRF token expiration you need page refresh rather than error on CodeIgniter / system / core / Security.php @ public function csrf_show_error(){...
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.2.4 or newer
*
* NOTICE OF LICENSE
*
* Licensed under the Open Software License version 3.0
*