[PHP]post传递数据时的报错Array to string conversion

当使用curl传递post数据时 , 数据的字段如果是个数组,就会报错Array to string conversion

在调用curl_setopt_array($curl, $options);

调用curl_setopt($ch, CURLOPT_POSTFIELDS, $data)

这两处地方都可能会报错 , 解决办法是把数据数组处理一下

http_build_query($data)