wc_normalize_postcode( string $postcode )

Normalize postcodes.


Description Description

Remove spaces and convert characters to uppercase.


Parameters Parameters

$postcode

(Required) Postcode.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/wc-formatting-functions.php

function wc_normalize_postcode( $postcode ) {
	return preg_replace( '/[\s\-]/', '', trim( wc_strtoupper( $postcode ) ) );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.