1
0
mirror of https://github.com/ZeroDream-CN/PHPMC7 synced 2026-05-29 19:19:56 +08:00

增加多语言支持,修复 utf8mb4 乱码问题

更新版本到 7.3.3325
This commit is contained in:
2018-10-19 18:39:25 +08:00
Unverified
parent 0794b18efc
commit d5d5962746
21 changed files with 392 additions and 171 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
class Lang {
public $lang;
public $data;
public function setLang($lang) {
$this->lang = $lang;
if(file_exists(ROOT . "/include/langs/{$lang}.php")) {
include(ROOT . "/include/langs/{$lang}.php");
$this->data = $langdata;
} else {
$this->data = Array();
}
}
public function str($text) {
$data = $this->data;
//file_put_contents(ROOT . "/lang.txt", "'{$text}' => '{$text}'", FILE_APPEND);
return isset($data[$text]) ? $data[$text] : $text;
}
}