yii和php的一些细节
2024-09-17 06:18:22
yii index.php
ini_set("display_errors", 1);
iconv这个函数不能直接用 需要检测!!!
function gb2312_utf8($str = ""){
if(function_exists("iconv")){
return iconv("gb2312", "utf-8//IGNORE", $str);
}else if(function_exists("mb_convert_encoding")){
return mb_convert_encoding($str, 'UTF-8', "gb2312");
}else{
die('gb2312_utf8 occur error!');
}
}
function utf8_gb2312($str = ""){
if(function_exists("iconv")){
return iconv("utf-8", "gb2312//IGNORE", $str);
}else if(function_exists("mb_convert_encoding")){
return mb_convert_encoding($str, 'gb2312', "UTF-8");
}else{
die('utf8_gb2312 occur error!');
}
}
最新文章
- PHP data
- ubuntu彻底卸载mysql
- Leap Motion发布新平台,直击下一代移动端VR/AR手部追踪
- Conntect Bluetooth devices in iOS.
- Ubuntu LAMP搭建
- Linux+Apache+Tomcat集群配置
- openstack手动玩转
- AngularJs练习Demo13Provider_factory
- WIFI机器人网
- 设置应用栏(Setting Up the App Bar)
- Java集合类源码解析:Vector
- java第7次作业
- bootstrap 坑
- Swinject 源码框架(一):基本原理
- chrome浏览器视频插件
- win7下安装ubuntu双系统的方法及心得体会(ps:要死好几回的节奏)
- Luogu_2774 方格取数问题
- WPF 动画:同为控件不同命 - 简书
- Electron小记
- PHP实现对站点内容外部链接的过滤方法