【问题标题】:file_get_contents post half of arrayfile_get_contents 发布数组的一半
【发布时间】:2015-01-02 19:04:09
【问题描述】:
$doSetupQ = http_build_query(
    array(
        "doSetup" => $doSetup
    )
);

$opts = array('http' =>
    array(
        'method'  => 'POST',
        'header'=> "Content-type: application/x-www-form-urlencoded",
        'content' => $doSetupQ
    )
);

$context  = stream_context_create($opts);

// call script to address V3
$path = "http://localhost/" . WWWBASE_V3 . "bin/doApi.php?company_id=" . $_SESSION['company_id'];
$returnDoApi = file_get_contents($path, false, $context);
$returnDoApi = unserialize($returnDoApi);

return $returnDoApi;

我有上面的代码。 在 doApi 脚本上,我只收到数组的一部分。(总是停在同一个元素处(也在子数组的中间。 (使用 curl 相同的问题) 可能有一些 memory_limit 左右,但找不到哪个。

【问题讨论】:

  • 在中途停止之前读取了多少数据?
  • 有错误吗?警告?

标签: php file-get-contents


【解决方案1】:

发现问题。 PHP 只允许发布 1000 个元素 :) 无法更改(php 5.2 中没有设置(我们使用该版本的原因是 ***))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-07-04
    • 2011-01-27
    • 2018-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多