1
我的应用程序控制器文件中有一堆curl语句。我怎么可能将它们全部合并成一个卷曲声明。这是否可能?谢谢CURL语句合并为一个
// used for curl and curl_post
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
// used for curl_twitter
curl_setopt($ch, CURLOPT_USERAGENT,'spider');
// used for curl_post, curl_auth
curl_setopt($ch,CURLOPT_POST, count($post_data_count));
curl_setopt($ch,CURLOPT_POSTFIELDS, $post_data_string);
// used for curl_twitter
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);C
http://php.net/manual/en/function.curl-setopt-array.php – dbinns66 2015-03-13 19:21:47