Location: PHPKode > scripts > Zodiacal Signs > zodiacal-signs/zodiacal.class.php
<?php
/////////////////////////////////////
// 1 - "Capricorn" 12/22-1/19
// 2 - "Aquarius" 1/20-2/18
// 3 - "Pisces" 2/19-3/20
// 4 - "Aries" 3/21-4/19
// 5 - "Taurus" 4/20-5/20
// 6 - "Gemini" 5/21-6/21
// 7 - "Cancer" 6/22-7/22
// 8 - "Leo" 7/23-8/22
// 9 - "Virgo" 8/23-9/22
// 10 - "Libra" 9/23-10/22
// 11 - "Scorpio" 10/23-11/21
// 12 - "Sagittarius" 11/22-12/21
//////////////////////////////////////

$zodiacSign=new Zodiacal();
$zodiacSign->GetSign(date("m",time()),date("d",time()));

class Zodiacal{

	function GetSign($month,$day){ 
		$dat=getdate(mktime(2,0,0,$month,$day)); 
		$dat=$dat["yday"]; 
		$g=Array(13=>356,12=>326,11=>296,10=>266,9=>235,8=>203,7=>172,6=>140,5=>110,4=>78,3=>51,2=>20,1=>0); 
		foreach ($g as $key=>$value) if ($dat>=$value) break; 
		if ($key>12) $key=1; 
		return $key; 
	} 	
}

?>
Return current item: Zodiacal Signs