Skip to content

Instantly share code, notes, and snippets.

@sineld
Created February 23, 2012 11:50
Show Gist options
  • Save sineld/1892524 to your computer and use it in GitHub Desktop.
Save sineld/1892524 to your computer and use it in GitHub Desktop.
Sinan helper class
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Sinan helper class.
*
* $Id: sinan.php 1.0 2012-02-22 20:06:38Z Geert $
*
* @package Sinan
* @author Sinan Eldem
* @copyright (c) 2012 Sinan Eldem
* @license http://kohanaphp.com/license.html
*/
class SINAN{
/**
* Cleans special chars from phone number.
*
* @param string phone number
* @return string
*/
public static function tel($tel)
{
return str_replace(array('(', ')', ' ', '-'), array(''), $tel);
}
public static function tarih($tarih)
{
$tar = explode('-', $tarih);
return $tar[2].'-'.$tar[1].'-'.$tar[0];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment