日記
Smarty modifier.mbconvert.php (13:51)Edit

Smartyのテンプレート上でマルチバイト文字コード変換を行う。あんまり使い道はなさそうな気もするけど、あってもいいだろう。pluginsディレクトリにつっこんでおく。Smartyテンプレート内で{$string|mbconvert:"urf-8":"euc-jp"}なんて感じで使う。

modifier.mbconvert.php

function smarty_modifier_mbconvert($string, $charset, $source_charset = 'auto') {
return mb_convert_encoding($string, $charset, $source_charset);
}

Published At2004-04-23 00:00Updated At2004-04-23 00:00