$ids = array_map('intval', $ids);
return $this->db->row("SELECT * FROM cources WHERE id IN (".join(',', $ids).")");
composer install
$_SERVER['REQUEST_URI']
$_SERVER['REQUEST_URI'] = '/catalog/1/page=2/ ';
$_SERVER['REQUEST_URI'] = '/catalog/1/order=named/page=2/ ';
<?php
$rel_canonical = '';
if(preg_match('!^/catalog/([0-9]+)!si', $_SERVER['REQUEST_URI'], $out))
{
$rel_canonical = "https://sayt.ru/catalog/{$out[1]}/";
}
//$rel_canonical выводим на странице
<meta http-equiv="refresh"
<?php
$html = file_get_contents('https://toster.ru');
$headers = [];
for($h = 1; $h <= 6; $h++)
{
preg_match_all('!<h'.$h.'.*?>(.*?)</h'.$h.'!usi', $html, $out);
if(isset($out[1]) && !empty($out[1]))
{
$headers["H".$h] = array_map('trim', $out[1]);
}
}
print_r($headers);
<?php
$lock = fopen(__DIR__ . '/lock_start.lock', 'w');
if (!($lock && flock($lock, LOCK_EX))) {
exit('already running');
}
//далее ваш код
$options = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-Language: en-US,en;q=0.9,ru;q=0.8\r\n".
"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.50 Safari/537.36 OPR/65.0.3467.16 (Edition beta)\r\n"
)
);
$context = stream_context_create($options);
$String = file_get_contents($url, false, $context);
if(mysqli_query($connection, $add)) {
echo "Добавлено";
} else {
var_dump(mysqli_error($connection));
exit;
}