$ch = curl_init();
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
$enCount = preg_match_all("/[A-z]{1}/", $string, $matches);
$ruCount = preg_match_all("/[А-я]{1}/", $string, $matches);
$lang = ($enCount > $ruCount) ? 'en' : 'ru';
function resolve_block_file()
{
$day = strtolower(substr(date('l'), 0, 3));
$hour = ((date('H') > 9) && (date('H') < 19)) ? 'day' : 'night';
if (file_exists('header-' . $day . '-' . $hour . '.php')) {
return 'header-' . $day . '-' . $hour . '.php';
}
if (file_exists('header-' . $day . '.php')) {
return 'header-' . $day . '.php';
}
return 'header.php';
}