<?php
require_once 'curl.func.php';
$appkey = 'your_appkey_here';//你的appkey
$num = 10;
$classid = 2;//分类id(二级id)
$start = 0;
$url = "https://api.jisuapi.com/recipe/byclass?appkey=$appkey&classid=$classid&start=$start&num=$num";
$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'];
foreach($result['list'] as $val)
{
echo $val['id'].' '.$val['classid'].' '.$val['name'].' '.$val['peoplenum'].'
';
echo $val['preparetime'].' '.$val['cookingtime'].' '.$val['content'].' '.$val['pic'].' '.$val['tag'].'
';
foreach($val['material'] as $v)
{
echo $v['mname'].' '.$v['type'].' '.$v['amount'].'
';
}
foreach($val['process'] as $v)
{
echo $v['pcontent'].' '.$v['pic'].'
';
}
}