<div class="phone"
<?
$Now = date(H);
$WorkDayStart = 9;
$WorkDayEnd = 18;
If ($WorkDayStart < $Now and $Now < $WorkDayEnd): ?>
<?$APPLICATION->IncludeComponent(
"bitrix:main.include",
"",
Array(
"COMPONENT_TEMPLATE" => ".default",
"AREA_FILE_SHOW" => "file",
"AREA_FILE_SUFFIX" => "inc",
"EDIT_TEMPLATE" => "",
"PATH" => "/include/telefon.php"
)
);?>
<?else:?>
<?$APPLICATION->IncludeComponent(
"bitrix:main.include",
"",
Array(
"COMPONENT_TEMPLATE" => ".default",
"AREA_FILE_SHOW" => "file",
"AREA_FILE_SUFFIX" => "inc",
"EDIT_TEMPLATE" => "",
"PATH" => "/include/email.php"
)
);?>
<?endif?>
</div>
<?
header("Content-Type: text/html; charset=utf-8");
Echo "Текущая кодировка: " . mb_internal_encoding(); ?> </br> <?
$ArrDir = glob("*.*"); //соберем файлы в текущей директории в массив
Echo "<b>Файлы в директории запуска скрипта:</b></br>";
foreach ($ArrDir as $key => $value)
{
Echo "Ключ: {$key} => Значение: {$value}</br> ";
}
Echo "<hr><b>Переменование битых имен файлов</b></br><hr>";
foreach($ArrDir as $name)
{
Echo "Имя файла до: $name</br>";
$name_decoded = preg_replace_callback('/[#_]u([0-9a-fA-F]{4})/i', function ($match) {
return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
}, $name);
Echo "Имя файла после: $name_decoded</br><hr>";
rename($name, $name_decoded);
}
?>