pm_Checker:: state Method

Checks whether the specified state name is well-formatted.

Syntax

public static function state ($state, $country)

Parameters

state

      A string value that specifies the state name to check.

country

      A string value that specifies what country the state in focus belongs to. Holds an empty string by default.

Returns

A mixed value. If the state name is well-formatted and the specified country is US or Canada, returns the array of strings containing states and their 2-character codes in the format '<state_name>=><state_code>'. If the state name is well-formatted and the country is unknown or not specified, returns the string with the passed in state, otherwise returns false.

Remarks

A well-formatted state name for a country different from US or Canada should be a string 0 to 50 characters long.