Skip to content

Instantly share code, notes, and snippets.

View KamranSyed's full-sized avatar
🏠
Working from home

Kamran Syed KamranSyed

🏠
Working from home
View GitHub Profile
@KamranSyed
KamranSyed / VisitorLocation.php
Last active May 5, 2018 18:30
Find Location by IP Address using PHP
<?php
/**
* This is part of a video tutorial
* at https://youtu.be/_HqS12AOwTk
* relevant instructions can be found
* in the description below the video.
*/
$ip = $_SERVER['REMOTE_ADDR'];
@KamranSyed
KamranSyed / WeatherForecastExample.php
Last active April 24, 2018 04:45
Php REST Client (Weather) Learning by Example
<?php
//This is part of a youtube video tutorial at https://youtu.be/gFg3BlQUJ0E
//include the rest client lib
//PHP REST Client https://github.com/KamranSyed/php-restclient
require_once 'restclient.php';
$url = "http://api.openweathermap.org/data/2.5/";
$api = new RestClient([
@KamranSyed
KamranSyed / CurrencyExchangeExample.php
Created April 22, 2018 06:51
Currency Exchange Rates Web Service Learning by Example
<?php
//This is used in a video tutorial at https://youtu.be/Y777FeIDicU
require_once 'restclient.php';
$url = "http://data.fixer.io/api/";
$api = new RestClient([
'base_url' => $url,
'format' => "json"
@KamranSyed
KamranSyed / restClientYoutubeExample.php
Last active April 21, 2018 17:57
PHP REST Client Learning by Example
<?php
//This gist is part of a video tutorial at https://youtu.be/TSWVm9VO-_U
require_once 'restclient.php';
$url = "https://api.github.com/users/";
$api = new RestClient([
'base_url' => $url,
'format' => "json"
]);