PHPでHTTPリクエストを作成するために使用する必要があるのはどれfile_get_contentsですか?curl
file_get_contents仕事をするなら、使う必要はありますかcurl?使用curlするにはもっと行が必要なようです。
例えば:
カール:
$ch = curl_init('http://www.website.com/myfile.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
curl_close ($ch);
file_get_contents:
$output = file_get_contents('http://www.website.com/myfile.php'.$content);