curl php总是curl_exec()
返回TRUE?
我做CURL Php并且总是TRUE,虽然没有互联网?以下编码有什么问题?
$POST = array(
'salesdata' => json_encode($sales_data)
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://accordpos.skyware.systems/api");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($POST));
// receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
$conn = $this->is_connected();
$this->db->trans_begin();
$this->sync_model->sales_sync($sales);
if(($server_output === false) ||($conn == 0))
{
echo "Error Number:".curl_errno($ch)."<br>";
echo "Error String:".curl_error($ch);
$this->db->trans_rollback();
}
else {
$this->db->trans_commit();
}
curl_close($ch);