【问题标题】:Get ID from array file_get_contents从数组 file_get_contents 中获取 ID
【发布时间】:2017-02-16 08:20:23
【问题描述】:

如何从数组中获取 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);

【问题讨论】:

    标签: parsing file-get-contents


    【解决方案1】:

    对不起,我做到了,只是使用 foreach() )))

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-12-18
      • 1970-01-01
      • 1970-01-01
      • 2021-05-06
      • 2013-07-07
      • 1970-01-01
      • 2016-11-19
      • 2018-10-26
      相关资源
      最近更新 更多