init
This commit is contained in:
236 files changed
+24692
No files matched your search
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use IntlChar;
|
||||
|
||||
class PhoneNumber
|
||||
{
|
||||
public static function dialString(string $number): string
|
||||
{
|
||||
$digits = preg_replace_callback('/\p{Nd}/u', fn (array $match): string => (string) IntlChar::digit($match[0]), $number);
|
||||
|
||||
return preg_replace('/[^+0-9]/', '', $digits);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user