This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Нужно написать на php функцию, которая принимает строку — текст на любом языке и | |
возвращает массив из 5 наиболее часто встречающихся слов в этом тексте. Ключ массива — слово, | |
значение — количество. Ни веб-сервер, ни база данных не понадобятся; версия php не имеет | |
значения. | |
*/ | |
function getWords(string $string): array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getWorkingDays($startDate, $endDate, $holidays) { | |
$endDate = strtotime($endDate); | |
$startDate = strtotime($startDate); | |
$days = ($endDate - $startDate) / 86400 + 1; | |
$no_full_weeks = floor($days / 7); | |
$no_remaining_days = fmod($days, 7); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Sticky</title> | |
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> | |
<style> | |
.top-0 { | |
top: 0 !important; | |
} | |
.bottom-0 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$bundles = []; | |
foreach(json_decode(file_get_contents(__DIR__ . '/composer.lock'))->packages as $package) { | |
if (!preg_match('#^bower-asset/(.+)$#', $package->name, $name) or !preg_match('#^v?(.+)$#', $package->version, $version)) { | |
continue; | |
} | |
$name = $name[1]; | |
$version = $version[1]; | |
switch ($name) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Набор методов для запроса к API uCoz. | |
* | |
* Пример использования на PHP-хостинге uCoz: | |
* <code> | |
* <?php | |
* $___notjson = 1; | |
* // Подключаем класс для работы с uAPI: |