Created
February 9, 2014 09:49
-
-
Save subdesign/8896835 to your computer and use it in GitHub Desktop.
Helper libraries 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Helper { | |
private static function changeMonth($string, $double = FALSE) | |
{ | |
if($double) | |
{ | |
$month_num = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); | |
} | |
else | |
{ | |
$month_num = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'); | |
} | |
$month_word = array('január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'); | |
$result = $month_word[$string-1]; | |
return $result; | |
} | |
public static function textMonth($date) | |
{ | |
$datum = date('Y.m.d.', strtotime($date)); | |
$ev = substr($datum, 0, 4); | |
$honap = self::changeMonth(substr($datum, 5, 2)); | |
$nap = substr($datum, 8 ,2); | |
return $ev.'. '.$honap.' '.$nap.'.'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment