note 83893 added to ref.calendar

From: Date: Tue, 17 Jun 2008 08:09:51 +0000
Subject: note 83893 added to ref.calendar
Groups: php.notes 
Request: Send a blank email to php-notes+get-140525@lists.php.net to get a copy of this message
This is the Japanese calendar in a basic formation of php.. <?php function JapaneseCalendar($unix_time, $gmt, $monthsystem = 0) { $months[0]['name'] = array( 'ichigatsu','nigatsu','sangatsu', 'shigatsu','gogatsu','rokugatsu', 'shichigatsu','hachigatsu','kugatsu', 'jūgatsu','jūichigatsu','jūnigatsu'); $months[0]['cause'] = array( 'first month', 'second month', 'third month', 'forth month', 'fifth month', 'six month', 'seventh month', 'eighth month', 'ninth month', 'tenth month', 'elventh month', 'twelve month'); $months[1]['name'] = array( 'mutsuki','kinusaragi','yayoi', 'uzuki','satsuki','minatsuki', 'fumizuki','hazuki','nagatsuki', 'kaminazuki','shimotsuki','shiwasu'); $months[1]['cause'] = array( 'affection month', 'changing clothes', 'new life', 'u-no-hana month', 'fast month', 'month of water', 'book month', 'leaf month', 'long month', 'month of gods', 'frost month', 'priests run'); $days['roman'] = array( 'nichiyōbi','getsuyōbi','kayōbi', 'suiyōbi','mokuyōbi','kin\'yōbi','doyōbi'); $days['element'] = array('Sun','Moon','Fire','Water', 'Wood','Gold','Earth'); $days['day'] = array( 'tsuitachi','futsuka','mikka','yokka', 'itsuka','muika','nanoka','yōka', 'kokonoka','tōka','jūichinichi', 'jūninichi','jūsannichi','jūyokka', 'jūgonichi','jūrokunichi', 'jūshichinichi','jūhachinichi', 'jūkunichi','hatsuka', 'nijūichinichi','nijūninichi', 'nijūsannichi','nijūyokka', 'nijūgonichi','nijūrokunichi', 'nijūshichinichi','nijūhachinichi', 'nijūkunichi','sanjūnichi', 'sanjūichinichi'); return array("date"=>$days['roman'][date('w', $unix_time)].' '. $days['day'][date('d', $unix_time)-1].' '. $months[$monthsystem]['name'][date('n', $unix_time)-1]. ' '.date('Y', $unix_time),"cause" => $days['element'][date('w', $unix_time)]. ' '.$months[$monthsystem]['cause'][date('n', $unix_time)-1], "time" => date('h:i:s A', $unix_time)); } ?> When I first ran this routine, I was referencing $month not $months, and for some reason it was still returning the month but not the cause, but the variable didn't exist. I found this odd around this time. I didn't know what would cause my RSS Feed to display the month even when there was no variable referred to the data. ---- Server IP: 117.104.160.194 Probable Submitter: 125.253.8.126 ---- Manual Page -- http://www.php.net/manual/en/ref.calendar.php Edit -- https://master.php.net/note/edit/83893 Del: integrated -- https://master.php.net/note/delete/83893/integrated Del: useless -- https://master.php.net/note/delete/83893/useless Del: bad code -- https://master.php.net/note/delete/83893/bad+code Del: spam -- https://master.php.net/note/delete/83893/spam Del: non-english -- https://master.php.net/note/delete/83893/non-english Del: in docs -- https://master.php.net/note/delete/83893/in+docs Del: other reasons-- https://master.php.net/note/delete/83893 Reject -- https://master.php.net/note/reject/83893 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#140525) next »