PHP code example of jetfueltw / lhczodiacwuxing-php

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

    

jetfueltw / lhczodiacwuxing-php example snippets


use Jetfuel\LhcZodiacWuxing\Zodiac;
use Jetfuel\LhcZodiacWuxing\Wuxing;

$zodiacNumbers = Zodiac::getZodiacNumbers(2020);
// [
//     'rat'     => [1, 13, 25, 37, 49],
//     'ox'      => [12, 24, 36, 48],
//     'tiger'   => [11, 23, 35, 47],
//     'rabbit'  => [10, 22, 34, 46],
//     'dragon'  => [9, 21, 33, 45],
//     ...
// ]

$numberZodiacs = Zodiac::getNumberZodiacs(2020);
// [
//     1 => 'rat',
//     2 => 'pig',
//     3 => 'dog',
//     4 => 'rooster',
//     5 => 'monkey',
//     ...
// ]

$dutyZodiac = Zodiac::getDutyZodiac(2020);
// 'rat'

$wuxingNumbers = Wuxing::getWuxingNumbers(2020);
// [
//     'metal' => [6, 7, 20, 21, 28, 29, 36, 37],
//     'wood'  => [2, 3, 10, 11, 18, 19, 32, 33, 40, 41, 48, 49],
//     'water' => [8, 9, 16, 17, 24, 25, 38, 39, 46, 47],
//     'fire'  => [4, 5, 12, 13, 26, 27, 34, 35, 42, 43],
//     'earth' => [1, 14, 15, 22, 23, 30, 31, 44, 45],
// ]

$numberWuxings = Wuxing::getNumberWuxings(2020);
// [
//     1 => 'earth',
//     2 => 'wood',
//     3 => 'wood',
//     4 => 'fire',
//     5 => 'fire',
//     ...
// ]