php curl指定远端IP

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://192.168.0.66/indexdata/');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: www.domain.com'));
$response = curl_exec($ch);
if (curl_errno($ch) != 0) {
	echo curl_error($ch);
} else {
	echo $response;
}
curl_close($ch);

你可能感兴趣的:(PHP,curl)