Hamdan Shafiq
asked on
how can check integer or string value in array
<?php
function get_data($url){
$ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)");
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$response=json_decode(curl_exec($ch),true);
curl_close($ch);
return $response;
}
$url='http://212.76.95.85:8844/CreateHWB.aspx?from=RYD&to=DMM&shipid=1223456789&shipssn=0&shipname=mohamad&shipphone=098765&shipcity=riyadh&shipaddress=Riyadh-Olayia&rcvssn=0&rcvname=toto&rcvphone=0546445819&rcvcity=dammam&rcvaddress=dammam-Raka%20&pkgdesc=IPHONE&codvalue=1700&pcs=1&customerno=110004&weight=3&passcode=TestPassword&refno=0';
$response=get_data($url);
print_r($response);
if(is_int($response[0][0]==true)) {
$$object=$response[0][0];
}else{
$object=$response[0][0];
echo '<font color="#cc0000">message:: '.$object.'</font>';
exit();
}
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
Now in your php code wich is the array var?