wc_sanitize_phone_number( string $phone )
Sanitize phone number.
Description Description
Allows only numbers and "+" (plus sign).
Parameters Parameters
- $phone
-
(Required) Phone number.
Return Return
(string)
Source Source
File: includes/wc-formatting-functions.php
function wc_sanitize_phone_number( $phone ) { return preg_replace( '/[^\d+]/', '', $phone ); }
Changelog Changelog
Version | Description |
---|---|
3.6.0 | Introduced. |