class language { private $language = array(); /** * calendar constructor. * @param string $language * @throws Exception */ public function __construct( $language = 'german' ) { $filename = $language . '.ini'; if( file_exists( $filename ) ) { $this->language = parse_ini_file( $filename, true ); } else { throw new Exception( $filename . ' not found!'); } } /** * @param int $timestamp * @return string */ public function getDayOfTheWeek( $timestamp ) { $weekday = date( 'w', $timestamp ); return $this->language['weekday'][ $weekday]; } /** * @param int $timestamp * @return string */ public function getMonth( $timestamp ) { $month = date( 'm', $timestamp ); return $this->language['month'][ $month]; } }