Coder Social home page Coder Social logo

itsbenatx / plunar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guojikai/plunar

0.0 2.0 0.0 26 KB

一个PHP版**农历(阴历)转换工具,用于将阳历日期转换为**农历(阴历)日期。(composer 安装)

License: MIT License

PHP 100.00%

plunar's Introduction

Plunar

一个PHP版**阴历转换工具,用于将阳历日期转换为**阴历日期。

Total Downloads Latest Stable Version Latest Unstable Version License Build Status

安装

使用 Composer 安装:

composer require guojikai/plunar

在入口文件引入 Composer 启动脚本: (eg. index.php)

require 'vendor/autoload.php';

使用

<?php

use Plunar\Plunar;
use Plunar\PlunarException;

try {
    //支持字符串输入形式 Plunar::solarToLunar('1984-09-22'); 
    $lunar_array = Plunar::solarToLunar(1984, 9, 22);
} catch (PlunarException $e) {
    echo $e->getMessage();
    exit;
}

var_dump($lunar_array);

?>

输出:

array:7 [
  0 => "一九八四" //阴历年
  1 => "八月" //阴历月
  2 => "廿七" //阴历日
  3 => "甲子" //天干地支
  4 => "" //生肖
  5 => "闰十月" //闰月
  6 => array:3 [ //阴历日期对应数字
    0 => 1984
    1 => 8
    2 => 27
  ]
]

plunar's People

Contributors

guojikai avatar larryli avatar

Watchers

James Cloos avatar Ben avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.