$access_token = "Токен"
switch($data->type) {
case 'video_new':
$video_id = $data->object->id;
$video_owner_id = $data->object->owner_id;
$videos = $video_owner_id . '_'.$video_id;
$videoInfo = file_get_contents("https://api.vk.com/method/video.get?videos={$videos}&count=1&extended=1&v=5.95&access_token={$access_token}");
$iframe = "<iframe src=\"{$videoInfo['response'][items][0]['player']}\" width="100%" height="100%" frameborder="0" allowfullscreen></iframe>";
if (isset($data->object->live)) { $video_live = $data->object->live; }
if ($video_live == 1) {
file_put_contents('./frame.txt', $iframe);
}
break;
}
$serviceNameValues = [];
foreach (explode(" ", $_GET['search-text']) as $key => $value) {
$serviceNameValues[] = $value;
}
$place_holders = implode(',', array_fill(0, count($serviceNameValues), '?'));
$number_of_pages = ceil($nresult_num/$results_per_page);
$this_page_first_result = ($page-1)*$results_per_page;
$rs = $pdo->prepare("SELECT * FROM services WHERE service_name IN ({$place_holders}) LIMIT {$this_page_first_result },{$results_per_page}");
$rs->execute($serviceNameValues);
$fetch = $rs->fetchAll();
$result_num = $rs->rowCount();
}
<?
$domain = "http://rabota-nakhodka.ru/post/";
$resultsPage = [];
$rowsPage = file('m.txt'); //превращаем в массив
print_r($rowsPage );
foreach($rowsPage as $getNameFile){ //проходим по массиву чтобы получить содержимое страниц
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $domain.$getNameFile);//подставляем значение из массива в адрес
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, "domain=rabota-nakhodka.ru&db=db");
$resultsPage[$getNameFile] = curl_exec($curl);
curl_close($curl);
sleep(5);
}
print_r($resultsPage);
?>