zoukankan      html  css  js  c++  java
  • yii和php的一些细节

    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!');
        }
    }

  • 相关阅读:
    HTML入门之003
    html入门之002
    HTML入门之001
    端口
    计算机基础
    二进制的学习
    markdown基础
    css基础
    html基础之三
    html基础之二
  • 原文地址:https://www.cnblogs.com/jami918/p/3534008.html
Copyright © 2011-2022 走看看