Skip to content

Instantly share code, notes, and snippets.

Jose Philip Raja josephilipraja

Block or report user

Report or block josephilipraja

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@josephilipraja
josephilipraja / Indian-States-and-Districts-PHP-Array.min.php
Last active Apr 22, 2018
Indian States & their Districts as PHP Array with 2 char State Code and in ascending order. Data fetched from http://districts.gov.in as on 21 Apr, 2018.
View Indian-States-and-Districts-PHP-Array.min.php
<?php
// Minified Indian-States-and-Districts-PHP-Array.php
// https://gist.github.com/josephilipraja/de1d4aa351f8dd75f3e486cd47fe9881
$IndianStates = ['AN'=>['name'=>'Andaman and Nicobar Island (UT)','districts'=>['Nicobar','North and Middle Andaman','South Andaman'],],'AP'=>['name'=>'Andhra Pradesh','districts'=>['Anantapur','Chittoor','East Godavari','Guntur','Krishna','Kurnool','Prakasam','Srikakulam','Sri Potti Sriramulu Nellore','Visakhapatnam','Vizianagaram','West Godavari','YSR District,Kadapa (Cuddapah)'],],'AR'=>['name'=>'Arunachal Pradesh','districts'=>['Anjaw','Changlang','Dibang Valley','East Kameng','East Siang','Kra Daadi','Kurung Kumey','Lohit','Longding','Lower Dibang Valley','Lower Siang','Lower Subansiri','Namsai','Papum Pare','Siang','Tawang','Tirap','Upper Siang','Upper Subansiri','West Kameng','West Siang'],],'AS'=>['name'=>'Assam','districts'=>['Baksa','Barpeta','Biswanath','Bongaigaon','Cachar','Charaideo','Chirang','Darrang','Dhemaji','Dhubri','Dibrugarh','Dima Hasao (North Cachar Hil
@josephilipraja
josephilipraja / google-recaptcha-verification.php
Last active Jan 19, 2019
Simple PHP Server-side verification of Google re-Captcha.
View google-recaptcha-verification.php
<?php
if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])):
// Your site secret key obtained from Google
$secret = '#####################################';
$grResponse = $_POST['g-recaptcha-response'];
// Verify with Google Servers
$verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$grResponse);
$responseData = json_decode($verifyResponse);
@josephilipraja
josephilipraja / countries.php
Last active Aug 19, 2019
List of Countries with Country code & Telephone (Dial) Code as a PHP Array. Bonus: PHP function to list all Countries as HTML Select Tag Options with their 2 character Country code as values
View countries.php
<?php
$countryArray = array(
'AD'=>array('name'=>'ANDORRA','code'=>'376'),
'AE'=>array('name'=>'UNITED ARAB EMIRATES','code'=>'971'),
'AF'=>array('name'=>'AFGHANISTAN','code'=>'93'),
'AG'=>array('name'=>'ANTIGUA AND BARBUDA','code'=>'1268'),
'AI'=>array('name'=>'ANGUILLA','code'=>'1264'),
'AL'=>array('name'=>'ALBANIA','code'=>'355'),
'AM'=>array('name'=>'ARMENIA','code'=>'374'),
'AN'=>array('name'=>'NETHERLANDS ANTILLES','code'=>'599'),
You can’t perform that action at this time.