WordPress at a glance

wc_format_phone_number() WC 1.0

Format phone numbers.

No Hooks.

Return

String.

Usage

wc_format_phone_number( $phone );
$phone(string) (required)
Phone number.

Code of wc_format_phone_number: woocommerce/includes/wc-formatting-functions.php VER 3.5.2

<?php
function wc_format_phone_number( $phone ) {
	if ( ! WC_Validation::is_phone( $phone ) ) {
		return '';
	}
	return preg_replace( '/[^0-9\+\-\s]/', '-', preg_replace( '/[\x00-\x1F\x7F-\xFF]/', '', $phone ) );
}

Related Functions

From category: WooCommerce

No comments
    Hello, !     Log In . Register