PHP code example of intervention / zodiac

1. Go to this page and download the library: Download intervention/zodiac 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/ */

    

intervention / zodiac example snippets


use Intervention\Zodiac\Calculator;
use DateTime;
use Carbon\Carbon;

// get zodiac object from a date
$zodiac = Calculator::zodiac('1980-09-15');

// method takes mixed formats
$zodiac = Calculator::zodiac('first day of June 2008');

// create from DateTime object
$zodiac = Calculator::zodiac(new DateTime('1977-03-15'));

// get zodiac from a Carbon object
$zodiac = Calculator::zodiac(Carbon::yesterday());

// get zodiac from unix timestamp
$zodiac = Calculator::zodiac(228268800);

use Intervention\Zodiac\Calculator;
use DateTime;
use Carbon\Carbon;

// calculate zodiac sing
$zodiac = Calculator::zodiac('1977-06-17');

$name = $zodiac->name(); // 'gemini'
$html = $zodiac->html(); // '♊︎'
$localized = $zodiac->localized('fr'); // Gémeaux
$compatibility = $zodiac->compatibility($zodiac); // .6