Skip to content

Instantly share code, notes, and snippets.

View BAHC's full-sized avatar

BAHC

View GitHub Profile
@BAHC
BAHC / ICSessions.php
Created June 28, 2018 13:59
Sessions
<?php
class ICSessions
{
static public function Init(){
if (!session_id()) @session_start();
return new ICSession;
}
public function Set($key='', $value='')
{
@BAHC
BAHC / turkey_exchange_rate.php
Created June 28, 2018 11:04
Turkish Lira Official Exchange Rate
<?php
/**
* Turkish Lira Official Exchange Rate
**/
function turkey_exchange_rate($_opt='', $_signs = 2)
{
$res = null;
$url = 'http://www.tcmb.gov.tr/kurlar/today.xml';
$xml = @simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA);
@BAHC
BAHC / exchange_rate.php
Last active June 28, 2018 19:54
Exchange Rates
<?php
function exchange_rate($_opt = [])
{
$_pairs = [];
foreach($_opt as $_k=>$_v)
{
$_pairs[] = $_k.'_'.$_v;
}
if(!count($_pairs)) return null;