pm_Checker:: zip Method

Checks whether the specified zip code is well-formatted.

Syntax

public static function zip ($zip, $country)

Parameters

zip

      A string value that specifies the zip code to check.

country

      A string value that specifies what country the zip code belongs to. Holds an empty string by default.

Returns

A boolean which is true if the zip code is well-formatted, false otherwise.

Remarks

A well-formatted zip code name should be a string 0 to 10 characters long. The US zip code should be a string of digits in one of the following formats: xxxxx, xxxxx-xxxx.