function processCurlJsonrequest($URL, $fieldString=array()){ //Initiate Curl request and send back the result
$fsC = count($fieldString);
$sendString = "";
foreach($fieldString as $fsv=>$fsk)
{
++$cfsC;
$sendString .= $fsv ."=";
$sendString .= $fsk;
if($cfsC != $fsC)
$sendString .= "&";
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $sendString);
curl_setopt($ch, CURLOPT_POST, 1);
$resulta = curl_exec ($ch);
if (curl_errno($ch)) {
print curl_error($ch);
} else {
curl_close($ch);
}
return $resulta;
}
$returnCurl = processCurlJsonrequest("http://bitclockers.com/api.json");
$return = json_decode($returnCurl);
$activeworkers = $return->activeworkers;
if($activeworkers > 500)
echo "100";
else
echo "1000000";
?>
I believe he wanted the same information (ie. the whole json) returned with just the workers changed.