Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100 off


PHP Tutorials and Scripts   




Title: Determining Astrological Signs    Marked Cool    (Review this resource)
Author: CYBER_Aeon
Posted On: 2004-11-16
Category: Home > PHP Hints and Tips

Popularity: 1 points out of 10    

Description: Determines the astrological sign associated with a month/day combination.

Total Hits: 955     Total Votes: 0     Total Points: 0 (0 reviews)        [ Download ]   

Page Navigation:  [1]


php:

//
// Control Variables
//

$Day = 12;
$Month = 1;

// -----------------------
// Begin Code
// -----------------------

// Calculate the number of days

$Offset = floor(((((mktime( 0, 0, 0, $Month, $Day, 0 ) - mktime( 0, 0, 0, 1, 0, 0 ))) / 60) / 60) / 24);

// Lookup the Sign based on the
// number of days past Jan 1

if ( $Offset >= 0 ) $Sign = "capricorn";
if ( $Offset >= 20 ) $Sign = "aquarius";
if ( $Offset >= 50 ) $Sign = "pices";
if ( $Offset >= 81 ) $Sign = "aries";
if ( $Offset >= 110 ) $Sign = "taurus";
if ( $Offset >= 141 ) $Sign = "gemini";
if ( $Offset >= 173 ) $Sign = "cancer";
if ( $Offset >= 204 ) $Sign = "leo";
if ( $Offset >= 235 ) $Sign = "virgo";
if ( $Offset >= 266 ) $Sign = "libra";
if ( $Offset >= 296 ) $Sign = "scorpio";
if ( $Offset >= 327 ) $Sign = "sagittarius";
if ( $Offset >= 357 ) $Sign = "capricorn";

//
// Results
//

echo $Offset;




Page Navigation:  [1]



© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.