str_replace - 隐藏 Phone 数字格式
str_replace - Hide Phone Number Formats
我想在字符串 PHP 中隐藏 telephone 号码的不同格式。
对那里的所有帮助感到困惑....
我可以使用什么函数在可以包含文本、符号和数字的字符串中隐藏以下任何 phone 格式?
(xxx) xxx-xxxx
xxx xxx xxxx
xxxxxxxxxx
+xx xx xxx xxxx
xxx - xxx xxxx
您可以执行以下操作:
echo preg_replace('/[^0-9.]/', '', '(+31) 111-2222 333 444 '); // 311112222333444
我想在字符串 PHP 中隐藏 telephone 号码的不同格式。 对那里的所有帮助感到困惑....
我可以使用什么函数在可以包含文本、符号和数字的字符串中隐藏以下任何 phone 格式?
(xxx) xxx-xxxx xxx xxx xxxx
xxxxxxxxxx
+xx xx xxx xxxx
xxx - xxx xxxx
您可以执行以下操作:
echo preg_replace('/[^0-9.]/', '', '(+31) 111-2222 333 444 '); // 311112222333444