A tool for determining zodiac signs based on date ranges.
Instantiate with Month and Day
<?php
use Krystal\Date\Zodiacal;
// Create for March 15th
$zodiac = new Zodiacal(3, 15);
// Get the zodiac sign
echo $zodiac->getSign(); // Outputs: Pisces
<?php
use Krystal\Date\Zodiacal;
// Create from a specific date
$date = new \DateTime('1990-07-31');
$zodiac = Zodiacal::fromDateTime($date);
echo $zodiac->getSign(); // Outputs: Leo
Returns the zodiac sign name for the current date.
$sign = $zodiac->getSign(); // Returns string (e.g. "Leo")
Check if the current date matches a specific sign (case-insensitive).
if ($zodiac->is('leo')) {
echo "You're a Leo!";
}
Method that returns all available zodiac signs.
$zodiacal = new Zodiacal(1,14);
print_r($zodiacal->getAvailableSigns());
Output
Array
(
[0] => Aries
[1] => Taurus
// ... etc
)