如何使用cURL获取少数网站的源代码? 我试过这样的事情
include_once 'simple_html_dom.php';
$linki = $_POST['linki'];
$link = explode("\n", $linki);
$html=array();
foreach($link as $x){
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $x);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$txt = curl_exec($c);
curl_close($c);
$html[] = str_get_html($txt);
}
foreach($html as $dupa){
echo "<div class='asd'>" . $dupa . "</div>";
}
但它仅从最后一个链接提供源代码