diff --git a/src/Libs/Libs.php b/src/Libs/Libs.php index da82a44..bdf470a 100644 --- a/src/Libs/Libs.php +++ b/src/Libs/Libs.php @@ -61,4 +61,12 @@ class Libs return null; } + public static function Phone(string $phone): string + { + $phone = preg_replace('/[^0-9]/', '', $phone); + if(strlen($phone) > 10 && substr($phone, 0, 1) == '1') { + $phone = substr($phone, 1); + } + return $phone; + } }