PHP CURL和JSON结果的缓存
我希望从一个curl得到json缓存结果,但得到错误 函数grabe($url、$dir、$rename、$time='0',$format='json')){ 我的182行index.php失败了PHP CURL和JSON结果的缓存,php,json,curl,caching,Php,Json,Curl,Caching,我希望从一个curl得到json缓存结果,但得到错误 函数grabe($url、$dir、$rename、$time='0',$format='json')){ 我的182行index.php失败了 $grab=grabe('https://www.googleapis.com/youtube/v3/search?key='.$key.'&part=snippet&order=relevance&maxResults=20&q=Latest+Bollywood+V
$grab=grabe('https://www.googleapis.com/youtube/v3/search?key='.$key.'&part=snippet&order=relevance&maxResults=20&q=Latest+Bollywood+Video&type=video');
这是因为您仅使用url调用grabe函数,而没有dir和rename参数的值 所以,你需要像这样的东西:
$grab=grabe('https://www.googleapis.com/youtube/v3/search?key='.$key.'&part=snippet&order=relevance&maxResults=20&q=Latest+Bollywood+Video&type=video', 'dir', $rename);
亲爱的,如何修复它?只需再传递两个参数。您正在执行$grab=grabe(url),必须在index.php的182行中执行$grab=grabe(url,'directory','rename')?是的,在方法的末尾添加两个参数
$grab=grabe('https://www.googleapis.com/youtube/v3/search?key='.$key.'&part=snippet&order=relevance&maxResults=20&q=Latest+Bollywood+Video&type=video');
$grab=grabe('https://www.googleapis.com/youtube/v3/search?key='.$key.'&part=snippet&order=relevance&maxResults=20&q=Latest+Bollywood+Video&type=video', 'dir', $rename);