PHP中的Foreach循环,键分配错误

OK, I admit this is a dull question but I cant find mistake.

So my code:

$this->table = array (
          "š" => "š",
          "Š" => "Š",
          "ý" => "ý",
          "Ý" => "Ý",
          "á" => "á",
          "Á" => "Á",
          "í" => "í",
          "Í" => "Í",
          "ú" => "ú",
          "Ú" => "Ú"
        );

$this->keyword = "š Č ú";

foreach ($this->table as $key => $value) {
                echo "key: ".$key." value ".$value." ";
                $this->keyword = str_replace($key, $value, $this->keyword);
            }

So I want to replace specials chars in var keyword according values in array, but this aint working. Output from this part of script is:

key: š value š key: Š value Š key: ý value ý ...

What am I doing wrong? Why is value $key same as $value?

Use htmlentities on $value, otherwise the entity (e.g. ú) will be rendered by the browser.

...
echo "key: ".$key." value ".htmlentities($value)." ";
...