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
$string = "ЧелоБрейк"; | |
function string_split_unicode($string, $length = 1) { | |
$tmp = preg_split('~~u', $string, -1, PREG_SPLIT_NO_EMPTY); | |
if ($length > 1) { | |
$chunks = array_chunk($tmp, $length); | |
foreach ($chunks as $i => $chunk) { | |
$chunks[$i] = join('', (array) $chunk); | |
} | |
$tmp = $chunks; | |
} |
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
$array_string = array( | |
0 => "Ч", | |
1 => "е", | |
2 => "л", | |
3 => "о", | |
4 => "Б", | |
5 => "р", | |
6 => "е", | |
7 => "й", | |
8 => "к" |
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
/** | |
* Замена любых символов в строке на любые другие | |
* | |
* @param [string] $string - входная строка | |
* @param [string] $a - что поменять | |
* @param [string] $b - на что поменять | |
* @return string - строка с замененными символами | |
*/ | |
function simbols_to_simbols($string, $a, $b) { | |
$array = explode($a, $string); |
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
/** | |
* Транслитерация строки из рус в анг символы. | |
* | |
* @param [type] $string - входная строка | |
* @param integer $length - длина обрабатываемой строки (по умолчанию вся строка (-1)) | |
* @return string - транслитерированная строка | |
*/ | |
function transliterator_srting_rus_to_eng($string, $length = 1) { | |
$array_rus_letters = preg_split('~~u', $string, -1, PREG_SPLIT_NO_EMPTY); | |
if ($length > 1) { |
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
#Защищаем .htaccess файл | |
<files .htaccess> | |
order allow,deny | |
deny from all | |
</files> |
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
/** | |
* Преобразует запись цвета из RGB в HEX. | |
* | |
* @param [string] $dec_color - цвет в десятичном формате 50, 100, 150; | |
* | |
* @return [string] - строка в шестнадцатиричном формате #326496; | |
*/ | |
function decToHex($dec_color) | |
{ | |
$arr_color = explode(', ', $dec_color); |
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
/** | |
* Получение имен файлов и каталогов в заданной дирректории. | |
* | |
* @param [string] $dir - дирректория | |
* @return array | |
*/ | |
function getNamesOfDir($dir) { | |
return array_slice(scandir($dir), 2); | |
} |
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
Tabs: | |
[ | |
{"caption":"Tab Title", "fields": [ | |
{"field":"title","caption":"Name"}, | |
{"field":"description","caption":"Description","inputTVtype":"textarea"}, | |
{"field":"imageTV","caption":"Photo","inputTV":"imageTV"} | |
]} | |
] | |
Table: |
OlderNewer