$url = 'https://www.tutu.ru/poezda/rasp_d.php?nnst1=2044800&nnst2=2004000';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_REFERER, "https://yandex.ru/search/?text=tutu");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_COOKIE, 'curl_normal_cookie=1; curl_session_cookie=1');
curl_setopt($ch, CURLOPT_COOKIEJAR, '/coockie/my_cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, '/coockie/my_cookies.txt');
$content = curl_exec($ch);
$info = curl_getinfo($ch);
if($info['http_code'] != 200) {
$fd = fopen("coockie/logs.txt", 'a');
$str_value = serialize($info);
$str = "\n".$str_value . "Маршрут" . $city_from . $city_to;
fwrite($fd, $str);
fclose($fd);
return;
}
curl_close($ch);
var_dump($content);
<script>
window.params =
$options = $model->roomOptions;
$provider = new ArrayDataProvider([
'allModels' => $options,
'pagination' => [
'pageSize' => 10,
],
'sort' => [
'attributes' => ['id', 'text'],
],
]);
echo GridView::widget([
'dataProvider' => $provider,
'summary' => false,