首页 生男生女 生男生女示例代码 按照月份查性别[PHP]

按照月份查性别示例代码[PHP]

作者: 阅读数:1685 上传时间:2016-03-10

按照月份查性别

<?php

require_once 'curl.func.php';

$appkey = 'your_appkey_here';//你的appkey
$age = '18';
$month = '10';
$url = "https://api.jisuapi.com/snsn/sex?appkey=$appkey&age=$age&month=$month";
$result = curlOpen($url, ['ssl'=>true]);

$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));

if($jsonarr['status'] != 0)
{
    echo $jsonarr['msg'];
    exit();
}

$result = $jsonarr['result'];
echo $result['sex'].'
';