public function getStateName($lookFor, $country = null)
    {
        if ($country) {
            if (! isset($this->states[$country])) {
                $this->findCountryStates($country);
            }

            if (isset($this->states[$country][$lookFor])) {
                return $this->states[$country][$lookFor];
            }

            throw new Exceptions\StateNotFoundException;
        }

        foreach ($this->countries as $countryCode => $countryName) {
            $this->findCountryStates($countryCode);

            if (isset($this->states[$countryCode][$lookFor])) {
                return $this->states[$countryCode][$lookFor];
            }
        }
    }
public function getStateName($lookFor, $country = null)
    {
        if ($country) {
            if (! isset($this->states[$country])) {
                $this->findCountryStates($country);
            }

            if (isset($this->states[$country][$lookFor])) {
                return $this->states[$country][$lookFor];
            }

            throw new Exceptions\StateNotFoundException;
        }

        foreach ($this->countries as $countryCode => $countryName) {
            $this->findCountryStates($countryCode);

            if (isset($this->states[$countryCode][$lookFor])) {
                return $this->states[$countryCode][$lookFor];
            }
        }
    }
public function getStateName ( $ lookFor , $ country = null ) { if ( $ country ) { if ( ! isset ( $ this -> states [ $ country ] ) ) { $ this -> findCountryStates ( $ country ) ; } if ( isset ( $ this -> states [ $ country ] [ $ lookFor ] ) ) { return $ this -> states [ $ country ] [ $ lookFor ] ; } throw new Exceptions \ StateNotFoundException ; } foreach ( $ this -> countries as $ countryCode => $ countryName ) { $ this -> findCountryStates ( $ countryCode ) ; if ( isset ( $ this -> states [ $ countryCode ] [ $ lookFor ] ) ) { return $ this -> states [ $ countryCode ] [ $ lookFor ] ; } } }
Get the name of a state by passing its two character code
Specifying a two character ISO country code will limit the search to a specific country

@param string $lookFor
@param string $country
@return string
Get the name of a state by passing its two character code Specifying a two character ISO country code will limit the search to a specific country