Geography.php
public function getUsStateAbbreviationForName($name)
    {
        if (!in_array($name, self::$usStates)) {
            return null;
        }

        return (string) array_search($name, self::$usStates);
    }
public function getUsStateAbbreviationForName($name)
    {
        if (!in_array($name, self::$usStates)) {
            return null;
        }

        return (string) array_search($name, self::$usStates);
    }
public function getUsStateAbbreviationForName ( $ name ) { if ( ! in_array ( $ name , self :: $ usStates ) ) { return null ; } return ( string ) array_search ( $ name , self :: $ usStates ) ; }
Gets the abbreviation for the provided state name, if this can be found - otherwise returns null.

@param string $name
@return string|null
Gets the abbreviation for the provided state name if this can be found - otherwise returns null .