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.
精彩评论