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
[xdebug] | |
;off Nothing is enabled (0 overhead) | |
;develop Enables Development Aids + overloaded var_dump() | |
;coverage Enables Code Coverage Analysis | |
;debug Enables Step Debugging | |
;gcstats Enables Garbage Collection Statistics | |
;profile Enables Profiling | |
;trace Enables the Function Trace feature | |
;Example: xdebug.mode=develop,trace |
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
<IfModule mod_setenvif.c> | |
SetEnvIfNoCase User-Agent ^$ bad_bot | |
SetEnvIfNoCase User-Agent "Bytespider" bad_bot | |
SetEnvIfNoCase User-Agent "Aboundex" bad_bot | |
SetEnvIfNoCase User-Agent "80legs" bad_bot | |
SetEnvIfNoCase User-Agent "360Spider" bad_bot | |
SetEnvIfNoCase User-Agent "Cogentbot" bad_bot | |
SetEnvIfNoCase User-Agent "Alexibot" bad_bot | |
SetEnvIfNoCase User-Agent "asterias" bad_bot |
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 | |
$success = false; | |
if (preg_match('/^(\+?7|8)\s?(\(\d{3,5}\)|\d{1,3})\s?\d{1,3}[-\s]?\d{1,3}[-\s]?\d{1,3}$/', $value)) { | |
$success = true; | |
} else { | |
$validator->addError($key, 'Неверный формат номера телефона!'); | |
} | |
return $success; |
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 | |
$number = $input; | |
$number = preg_replace('/[^0-9]/', '', $number); // удаление всех символов, кроме цифр | |
if (strlen($number) === 11) { // номер с кодом страны | |
$formattedNumber = preg_replace('/(\d{1})(\d{3})(\d{3})(\d{2})(\d{2})/', '8 ($2) $3-$4-$5', $number); | |
} elseif (strlen($number) === 10) { // номер без кода страны | |
$formattedNumber = preg_replace('/(\d{3})(\d{3})(\d{2})(\d{2})/', '8 ($1) $2-$3-$4', $number); | |
} |
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 | |
if (!empty($input)) { $input = preg_replace("/[^+0-9]/", '', $input); $input = preg_replace("/^(8)/", '7', $input); } return $input; |