Last active
March 8, 2019 23:46
-
-
Save dataich/de5ccba89cd76d07963d2bc3c2de05dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// | |
// 画面出力時に、テンプレートをUTF-8からSJISに変換する。 | |
// | |
function filterUTF8ToSJIS($buff, &$smarty) { | |
return mb_convert_encoding($buff,"SJIS","UTF-8"); | |
} | |
$smarty= new Smarty(); //Smartyオブジェクト生成 | |
$smarty->register_outputfilter("filterUTF8ToSJIS"); //フィルターの登録 | |
ini_set("default_charset", "Shift_JIS"); //PHPの設定default_charsetにSJISを設定 | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment