You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
399 B
21 lines
399 B
<?php |
|
/** |
|
* Created by Error202 |
|
* Date: 23.09.2018 |
|
*/ |
|
|
|
namespace core\helpers; |
|
|
|
class PhoneHelper |
|
{ |
|
public static function normalizePhone(string $phone): string |
|
{ |
|
return preg_replace('/[^0-9]/', '', $phone); |
|
} |
|
|
|
public static function isCorrect(string $phone): bool |
|
{ |
|
$string = PhoneHelper::normalizePhone($phone); |
|
return strlen($string) == 11; |
|
} |
|
}
|
|
|