function get_url_data($url){
$ch = curl_init($url);
session_start();
// curl_setopt($ch, CURLOPT_URL,$url);
//証明書を無視
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
//タイムアウトの設定
curl_setopt( $ch, CURLOPT_TIMEOUT, 50 );
$getCode = curl_exec($ch);
curl_close($ch);
return $getCode;
}
// POST用のメソッド
function get_url_data_post($url,$arr){
$postdata = http_build_query($arr);
$ch = curl_init();
session_start();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
$getCode = curl_exec($ch);
curl_close($ch);
return $getCode;
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme