八字起大运php代码,八字排盘示例代码

require_once 'curl.func.php';

$appkey = 'your_appkey_here';//你的appkey

$city = '';//utf8

$year=2009;

$month=10;

$day=18;

$hour=2;

$minute=5;

$sex=1;

$istaiyang=0;

$islunar=0;

$url = "http://api.binstd.com/bazi/paipan?appkey=$appkey&city=$city&year=$year&month=$month&day=$day&hour=$hour&minute=$minute&sex=$sex&istaiyang=$istaiyang&islunar=$islunar";

$result = curlOpen($url);

$jsonarr = json_decode($result, true);

//exit(var_dump($jsonarr));

if($jsonarr['status'] != 0)

{

echo $jsonarr['msg'];

exit();

}

$result = $jsonarr['result'];

echo $result['year'].' '.$result['month'].' '.$result['day'].' '.$result['hour'].' '.$result['minute'].' '.$result['name'].' '.$result['city'].' '.$result['istaiyang'].' '.$result['lunaryear'].' '.$result['lunarmonth'].' '.$result['lunarday'].' '.$result['lunarhour'].' '.$result['animal'].' '.$result['yearganzhi'].'

';

echo '上一个节气:

';

echo $result['jieqiprev']['jieqiname'].' '.$result['jieqiprev']['date'].'

';

echo '下一个节气:

';

echo $result['jieqinext']['jieqiname'].' '.$result['jieqinext']['date'].'

';

echo implode(' ', $result['bazi']).' '.$result['taiyuan'].' '.$result['minggong'].' '.implode(' ', $result['xunkong']).'

';

echo implode(' ', $result['qiyun']).' '.implode(' ', $result['jiaoyun']).'

';

echo implode(' ', $result['qiankunzao'][0]).' '.implode(' ', $result['qiankunzao'][1]).' '.implode(' ', $result['qiankunzao'][2]).'

';

echo implode(' ', $result['nayin']).'

';

foreach($result['shensha'] as $shensha)

{

echo implode(' ', $shensha). '

';

}

$dayun = $result['dayun'];

echo implode(' ', $dayun['nayin']). '

';

echo implode(' ', $dayun['shishen']). '

';

echo implode(' ', $dayun['ganzhi']). '

';

echo implode(' ', $dayun['sui']). '

';

echo '流年:

';

foreach($result['liunian'] as $liunian)

{

echo implode(' ', $liunian). '

';

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值