Tutorials Infos - Anleitungen - Hilfe - Dreamcodes
 

Sternzeichen

Dieses Script gibt das Sternzeichen des eingegebenen Datums aus

Script:
<?php

   
function sternzeichen($day, $month) {
      
$zodiac = array('Steinbock','Steinbock','Wassermann','Fische','Widder',
                      
'Stier','Zwilling','Krebs','Löwe','Jungfrau','Waage',
                      
'Skorpion','Schütze');

      
$dates = array( 0 => array(mktime(0,0,0,12,22), mktime(0,0,0,12,31)),
                      
1 => array(mktime(0,0,0,01,01), mktime(0,0,0,01,19)),
                      
2 => array(mktime(0,0,0,01,20), mktime(0,0,0,02,18)),
                      
3 => array(mktime(0,0,0,02,19), mktime(0,0,0,03,20)),
                      
4 => array(mktime(0,0,0,03,21), mktime(0,0,0,04,19)),
                      
5 => array(mktime(0,0,0,04,20), mktime(0,0,0,05,20)),
                      
6 => array(mktime(0,0,0,05,21), mktime(0,0,0,06,21)),
                      
7 => array(mktime(0,0,0,06,22), mktime(0,0,0,07,22)),
                      
8 => array(mktime(0,0,0,07,23), mktime(0,0,0,08,22)),
                      
9 => array(mktime(0,0,0,08,23), mktime(0,0,0,09,22)),
                     
10 => array(mktime(0,0,0,09,23), mktime(0,0,0,10,23)),
                     
11 => array(mktime(0,0,0,10,24), mktime(0,0,0,11,21)),
                     
12 => array(mktime(0,0,0,11,22), mktime(0,0,0,12,21)));

      foreach(
$dates as $k=>$v) {
         if(
mktime(0,0,0,$month,$day) >= $v[0] && mktime(0,0,0,$month,$day) <= $v[1]) {
            return
$zodiac[$k];
         }
      }
      return
FALSE;
   }

   echo
sternzeichen(19, 4); // Tag, Monat

?>

 
ID: 400
eingestellt am: 10.05.2004
Autor: Hendrik Walter
Status zum lesen: Gast
gelesen: 8186
Webseite: www.dreamcodes.com
[Drucken]