I have this code:
<?php
header('Content-Type: text/html; charset=utf-8');
error_reporting(E_ERROR | E_WARNING | E_PARSE & ~E_NOTICE);
$uarray = json_decode($_POST['array']);
$uac = $uarray;
$res = $uarray;
function request_callback($response, $info, $request) {
global $uac;
global $res;
$index = array_search($request->{'url'}, $uac);
$uac[$index] = " ";
$rspnc = json_decode($response);
$res[$index] = $rspnc;
}
require("RollingCurl.php");
$rc = new RollingCurl("request_callback");
$rc->options = array(CURLOPT_BINARYTRANSFER => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false);
$rc->window_size = 5;
foreach ($uarray as $url) {
$request = new RollingCurlRequest($url);
$rc->add($request);
}
$rc->execute();
for($i = 0; $i <= count($res); $i++)
{
for ($j = 0; $j <= 1; $j++) {
echo $res[$i]->{'name'};
echo "/";
echo $res[$i]->{'quality'};
echo "/";
echo $res[$i]->{'buy_offers'}[$j]->{'o_price'};
echo "/";
echo $res[$i]->{'buy_offers'}[$j]->{'c'};
echo "/";
echo $res[$i]->{'buy_offers'}[$j]->{'my_count'};
echo "/";
echo $res[$i]->{'classid'}. "_" .$res[$i]->{'instanceid'};
echo "<br>";
}
echo "<p><p><p>";
}
?>
And im getting memory limit error in this string:
$index = array_search($request->{'url'}, $uac);
Array $uarray contains 10000 urls. I have already changed memory_limit value in php.in to -1. phpinfo() displaying memory_limit value as -1. So I have suppose that error occured because of 32bit PHP and Apache. I have windows 64bit with 16GB ram. So problem in the code. Help me rewrite this code especially array_search function in the way that original array will be sliced and merged back or so. Sorry for my language.