DaFunkyAlex
DaFunkyAlex

Reputation: 1969

php special chars (umlaute) from URL

I'm getting mad with this utf8 and ansi and ascii stuff. Always the same old story...

I have an url that includes a GET parameter: http://www.example.com/?c=Österreich

In my PHP script, I make a switch:

switch ( strtolower( $country ) ) {
  case "deutschland":
    $country = "DE";
    break;

  case "österreich":
    $country = "AT";
    break;

  case "schweiz":
    $country = "CH";
    break;

  default:
    $country = "DE";
    break;
}

For Östereich, I get the default value "DE". So how to solve this?

Upvotes: 0

Views: 123

Answers (1)

Shu
Shu

Reputation: 5109

You need to use multibyte functions to manage UTF8 strings, so mb_strtolower() instead of strtolower()

Upvotes: 3

Related Questions