Curl Error No: ".curl_errno($ch)."
For further info please see: http://curl.haxx.se/libcurl/c/libcurl-errors.html";
exit;
}
}
curl_close($ch);
return $nvpResArray;
}
/** This function will take NVPString and convert it to an Associative Array and it will decode the response.
* It is usefull to search for a particular key and displaying arrays.
* @nvpstr is NVPString.
* @nvpArray is Associative Array.
*/
function deformatNVP($nvpStr)
{
$intial=0;
$nvpArray = array();
while(strlen($nvpStr)){
//postion of Key
$keypos= strpos($nvpStr,'=');
//position of value
$valuepos = strpos($nvpStr,'&') ? strpos($nvpStr,'&'): strlen($nvpStr);
/*getting the Key and Value values and storing in a Associative Array*/
$keyval=substr($nvpStr,$intial,$keypos);
$valval=substr($nvpStr,$keypos+1,$valuepos-$keypos-1);
//decoding the respose
$nvpArray[urldecode($keyval)] =urldecode( $valval);
$nvpStr=substr($nvpStr,$valuepos+1,strlen($nvpStr));
}
return $nvpArray;
}
?>