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