开发者

How to display umlauts in a web page?

开发者 https://www.devze.com 2023-03-28 21:29 出处:网络
Hi I was wondering what is a quick way of showing umlauts on your page? I was thinking something like the code below, but how should I do the pseudocode part?

Hi I was wondering what is a quick way of showing umlauts on your page? I was thinking something like the code below, but how should I do the pseudocode part?

$language = $_POST['language'];

if ($language = "fi" ) {
    $filename = "C:/xampp/htdocs/finnish.txt";
} else if ($language = "eng") {
    $filename = "C:/xampp/htdocs/english.txt";
} else if ($language = "swe")  {
    $filename = "C:/xampp/htdocs/swedish.txt";
} else if ($language = "rus") {
    $filename = "C:/xamp开发者_如何学Pythonp/htdocs/russian.txt";
}

$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize($filename));
fclose ($fd);

$delimiter = "*";
$splitcontents = explode($delimiter, $contents);
$counter = 0;

foreach($splitcontents as $titles[$counter]) {
    //PSEUDO CODE
    CONVERT_UMLAUTS_TO_VIEVABLE_FORM($titles[$counter]);
    $counter = $counter + 1;
}


The best way is to store and show all data in UTF-8 encoding.

0

精彩评论

暂无评论...
验证码 换一张
取 消