我正在使用卷曲。那个服务根据通过检查数据库传递给它的值返回0或1。当我使用
echo $result
$result = curl_exec($ch);
if ( $result == 0 )
{
echo("Valid");
}
else
{
echo("Invalid");
}
VarDump是--->字符串(103)“0”
:
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
//So that curl_exec returns the contents of the cURL; rather than echoing it
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
:
C#Web服务代码
try { if (dr.HasRows) { c.Close(); return 0; } else { c.Close(); return 1; } }