PHP code example of whatsma / zodiacsign

1. Go to this page and download the library: Download whatsma/zodiacsign library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

whatsma / zodiacsign example snippets



Whatsma\ZodiacSign;

$calculator = new ZodiacSign\Calculator();

try {
    $day = 17;
    $month = 8;
    $zodiacSign = $calculator->calculate($day, $month);
    echo $zodiacSign . "\n";
} catch (ZodiacSign\InvalidDayException $e) {
    echo "ERROR: Invalid Day";
} catch (ZodiacSign\InvalidMonthException $e) {
    echo "ERROR: Invalid Month";
}

// output: "leo"