smarty options中文显示不正常

ws_123456 2012-10-08 11:43:54
就显示星期一其他的都不显示好像就不是中文跟中文星期一会匹配其他的中文就不匹配了
<?php
require '../libs/Smarty.class.php';
$smarty = new Smarty;

$vals=array('1','2','3','4','5','6','7');
$output=array('星期一','星期二','星期三','星期四','星期五','星期六','星期日');

$smarty->assign('selected','selected');
$smarty->assign('vals',$vals);
$smarty->assign('output',$output);

$smarty->display('index.tpl');
?>
<SELECT name=company>
{html_options values=$vals selected=$selected output=$output}
</SELECT>
填写数字跟字母是可以的
求助怎么回事
...全文
182 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
ws_123456 2012-10-08
  • 打赏
  • 举报
回复
是smarty设置检查utf-8咯所以不能显示
xuzuning 2012-10-08
  • 打赏
  • 举报
回复
乱码?
检查文件保存时的编码是否一致
ws_123456 2012-10-08
  • 打赏
  • 举报
回复
<?php
require '../libs/Smarty.class.php';
$smarty = new Smarty;

$vals=array('1','2','3','4','5','6','7');
$output=array('a','b','c','d','e','f','g');

$smarty->assign('selected','selected');
$smarty->assign('vals',$vals);
$smarty->assign('output',$output);

$smarty->display('index.tpl');
?>
<SELECT name=company>
{html_options values=$vals selected=$selected output=$output}
</SELECT>两种不同的结果

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧