Search code examples
phpfile-get-contents

file_get_contents post half of array


$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;

I have the code from above. On the doApi script I only receive a part of the array.(stop always at the same element (also in the middle of the subarray. (using curl same issue) Probably some memory_limit or so but can't find which one.


Solution

  • Found issue. PHP just aalows 1000 elements to be posted :) Not able to change it (no setting in php 5.2 (why we use that version is ***))