PHP code example of jetfueltw / solarlunar-php

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


use Jetfuel\SolarLunar\SolarLunar;

$solar = Solar::create(2015, 1, 15);
$lunar = SolarLunar::solarToLunar($solar);
// Lunar {
//     "year" => 2014,
//     "month" => 11,
//     "day" => 25,
//     "isLeap" => false
// }

$lunar = Lunar::create(2014, 11, 25, false);
$solar = SolarLunar::lunarToSolar($lunar);
// Solar {
//     "year" => 2015,
//     "month" => 1,
//     "day" => 15
// }