Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Parsing 从数组文件获取ID\u获取内容_Parsing_File Get Contents - Fatal编程技术网

Parsing 从数组文件获取ID\u获取内容

Parsing 从数组文件获取ID\u获取内容,parsing,file-get-contents,Parsing,File Get Contents,如何从数组中获取ID以从URL获取和放置内容。需要从url获取数据并将其保存在文件夹中。我是PHP新手,尝试过类似的方法,但它对我来说不适用: $array = array("10", "11", "12"); $contents = file_get_contents('http://www.example.cpm/id='.$array.'&type=text'); file_put_contents('folder/'.$array.'.html', $contents); 抱歉

如何从数组中获取ID以从URL获取和放置内容。需要从url获取数据并将其保存在文件夹中。我是PHP新手,尝试过类似的方法,但它对我来说不适用:

$array = array("10", "11", "12");
$contents = file_get_contents('http://www.example.cpm/id='.$array.'&type=text');
file_put_contents('folder/'.$array.'.html', $contents);

抱歉,我这么做了,只是使用了foreach()