PHP code example of shiren / yao

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

    

shiren / yao example snippets


  $eye = \Shiren\Yao\Eye::create([1, 2, 0, 0, 0, 3], [6, 10], [2, 2])->look();
  \Shiren\Yao\Visible::instance($eye)->show(true);

  //庚戌月丙寅日  
  //山雷颐之地泽临 木  
  //6   青 兄 -0- 寅[       ] 酉 官  
  //5   玄 父 - - 子[    伏巳子]      
  //4 世 白 才 - - 戌[空 建    ]      
  //3   蛇 才 - - 辰[  破    ]      
  //2   勾 兄 -x- 寅[       ] 卯 兄  
  //1 应 朱 父 --- 子[       ]   
  

  // 需要自己转换参数
  $data = \Shiren\Yao\Eye::create([1, 2, 0, 0, 0, 3], [6, 10], [2, 2])->look()->toArray();
  // 以下无需自己转换参数
  $eye = \Shiren\Yao\Eye::create([1, 2, 0, 0, 0, 3], [6, 10], [2, 2])->look();
  $data = \Shiren\Yao\Visible::instance($eye)->show();