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

  • 相关阅读:
    12迭代器
    11(2)Vector(向量)
    11(1) LinkList ---链表
    11集合(Collection<E>) Arraylist
    10异常
    乘法计算过程的模拟
    10 Date详解
    详细的OA系统学习
    8 math类
    Java开发中的23种设计模式详解
  • 原文地址:https://www.cnblogs.com/jami918/p/3534008.html
Copyright © 2011-2022 走看看