- $data = array( 'Title' => $title, 'Content' => $content, 'ComeFrom' => $comefrom );
- curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false);
- curl_setopt($ch, CURLOPT_URL, 'http://example.com/b.php');
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- curl_exec($ch);
-
将所要提交的数据以数组的形式通过 POST 发送,而这样就会导致 CURL 使用“错误"的编码“multipart/form-data",其效果相当于直接以“ |