This file contains hidden or 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
//Заголовок станицы | |
<? $APPLICATION->SetPageProperty('title', 'Какой-то заголовок (новый)'); ?> | |
//Вывод массива | |
<? | |
//удобный вывод дампа в php.ini | |
function sl_dump($var, $all = false, $die = false) | |
{ | |
global $USER; | |
if(($USER->isAdmin() == 1) || ($all == true)) | |
{ |
This file contains hidden or 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
SELECT * FROM stuff WHERE EXTRACT(MONTH FROM `birthdate`) = '12' OR EXTRACT(MONTH FROM `birthdate`) = '1' |
This file contains hidden or 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
Заспрос для отделения таймкодов после расшифровки чата Jazz | |
(<2)*(>\):) | |
Найти даты | |
[0-9]{2}.[0-9]{2}.[0-9]{4} |
This file contains hidden or 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
Private Declare Function ActivateKeyboardLayout _ | |
Lib "user32" (ByVal HKL As Long, ByVal flags As Long) As Long | |
Const kb_lay_ru As Long = 68748313, kb_lay_en As Long = 67699721 | |
Private Sub Worksheet_SelectionChange(ByVal Target As Range) | |
'Так работает для листа Если надо для всей книги то оборачиваем в Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) | |
Select Case Target.Column ' select Column | |
Case 7 ' for column 7 | |
SetRusLayout | |
Case 2 To 6: ' for Columns fron 2 to 6 |
This file contains hidden or 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
Создание симлинков при обращении к d:\domains\chelduma.loc\bitrix переадрессовывает на d:\domains\shared_chelduma.loc\bitrix | |
mklink /D d:\domains\chelduma.loc\bitrix d:\domains\shared_chelduma.loc\bitrix | |
mklink /D d:\domains\smichelduma.loc\bitrix d:\domains\shared_chelduma.loc\bitrix | |
mklink /D d:\domains\chelduma.loc\upload d:\domains\shared_chelduma.loc\upload | |
mklink /D d:\domains\smichelduma.loc\upload d:\domains\shared_chelduma.loc\upload | |
удаление симлинков | |
erase d:\domains\chelduma.loc\upload d:\domains\smichelduma.loc\upload |
This file contains hidden or 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 | |
$date = date("Ymd"); | |
echo "$date"; |
This file contains hidden or 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
//Повторить строку 40 раз | |
echo str_repeat("<h2>Hello World</h2>", 40); | |
//возвращает строку в которой порядок символов изменен на обратный | |
$string = strrev("Hello"); //olleH | |
//заполняет одну строку другой строкой. Опционально вы можете дополнить строку слева, справа или с обоих сторон до заданной длины: | |
$string = str_pad('Fred Flintstone', 30, '.'); | |
echo "$string"."45"; //Fred Flintstone...............45 | |
//позволяет несколько раз обрабатывать строку и получать новый ее фрагмент при каждой следующей итерации. | |
// При первом вызове функции нужно передать два аргумента строку, по которой нужно итерировать и разделитель | |
//Для получения оставшихся элементов, нужно в цикле повторить вызов strtok() только с разделителем |
This file contains hidden or 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 | |
$sl=mb_convert_case("переводит первую букву каждого слова в верхний регистр", MB_CASE_TITLE, "UTF-8"); | |
$sl=mb_convert_case("переводит все буквы каждого слова в верхний регистр", MB_CASE_UPPER, "UTF-8"); |
This file contains hidden or 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 getSum(){ | |
//Если аргументов не передано возвращаем false | |
if (func_num_args()==0) return false; | |
$count = 0; | |
//func_get_arg($i) позиция аргумента в массиве всех переданных аргументов | |
for ($i=0; $i<func_num_args(); $i++){ | |
$count +=func_get_arg($i); | |
} | |
return $count; |
This file contains hidden or 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 форму | |
<input type='submit' value='Назад' onclick='history.back(); return false;'> | |
//Автоматическая перемотка к первому результату поиска точнее к нижней кнопке | |
<script> | |
document.getElementById('backBtn').scrollIntoView(); | |
</script> |
NewerOlder