php中输出中文字符乱码解决思路

WBOY
Release: 2016-06-13 12:33:26
Original
704 people have browsed it

php中输出中文字符乱码
问题如下:
$load_list 是一个二维数组,将其中的user_name值取出前两个字符,后面用星号代替,但是遇到中文字符就出现乱码,设置header()函数,也没用,求解决办法,谢谢!
foreach($load_list as $k=>&$v){
 $temp=&$v['user_name'];

 for($i=0,$len=strlen($temp);$i if($i>1){
  $temp[$i]='*';
}
 }
}

截图如下:

foreach乱码
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!