yii   index.php

ini_set("display_errors", 1);

iconv This function cannot be used directly Need to detect !!!

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

yii and php More related articles on some details of

  1. yii Little details

    1.main.php Add navigation bar to be case sensitive , Otherwise 404 error 2. increase ' Pagination ' function --- Front and back models Inside search.php add to public function search($pa ...

  2. yii Some small details in the framework

    1. View run time 'db'=>array(      'connectionString' => 'mysql:host=localhost;dbname=shop',      'emul ...

  3. YII Source code analysis (-)

    As the first show of source code analysis , I chose yii( Read as crooked Yiyi, not crooked love ): I won't say more about its praise , Go straight to the point . Prepare the materials first , It is recommended to download it directly from the official website yii The source package (1.1.15). stay demos There's one of the simplest applications —h ...

  4. Yii Learning from (1)-- Installation configuration

    Before that sina The blog has written Yii The article , After coming to the blog Garden , No more about Yii The article , It's just that there's nothing wrong with the Dragon Boat Festival holiday , Combined with previous blogs ,Yii Official documents of , Plus the latest about Yii To sum up , Write a series ~~ Yii It's a base ...

  5. Yii Error and exception handling in

    Yii Error and exception handling in Yii It's already in... By default CApplication Exception and error take over are implemented on , This is through php Of set_exception_handler, set_error_handler Realized . ...

  6. yii Detailed explanation framework And internationalization (I18N)

    We need to open the language configuration in the component , The default is CPhpMessageSource, It can also be changed to other ways . # In component configuration  'messages' => array(     'class'=> ...

  7. Yii introduction , Sign in

    Authentication and authorization are used when page access needs to be restricted . Verification is to confirm that someone is the person he claims to be . It usually involves a user name and password , But there are other ways , For example, smart card , Fingerprints, etc . Authorization is after authenticating the user , Find out if he is allowed to manage the assigned resources . He is usually judged to be ...

  8. yii frame AR Detailed explanation

    though however Yii DAO Can handle virtually any database related task , But it's very likely that we'll spend 90% Time to write some generic SQL Statement to execute CRUD operation ( establish , Read , Update and delete ). At the same time, it's hard for us to maintain these PHP and SQL language ...

  9. yii Quick start and reference

    Yii Authoritative guide http://www.yiichina.com/guide/ http://www.yiiframework.com/doc/guide/1.1/zh_cn/ Ⅰ. Basic concept one . Entrance text ...

Random recommendation

  1. Stay Hungry

    Keep hungry , Physically , It can keep maneuvering at any time , therefore , Breakfast today . Lunch . dinner , I'm not even full . When you want to relax , Just a big meal , It's not necessarily a kind of happiness ! spiritual , Keep hungry , I don't know what kind of state it is , Nature also describes ...

  2. Dijkstra Algorithm and Floyd Algorithm HDU 1874 Unimpeded project continued

    Dijkstra The algorithm is easy to describe : It is to find the shortest path of a single source , That is to find the shortest path from a point to other points , General idea and prim The algorithm is pretty much the same , There's an array dis, It is used to save the distance between the source point and other points , It was easy at first , Only need to ...

  3. utilize glibc The information of lock structure solves the deadlock problem

        First of all, I would like to thank Lao Ding and Lao Li for their help , Without them, it will take a long time to solve this problem . Meet this problem , It's a headache . Not familiar with the code . Not familiar with the process , But the leader still put the life in the queue ( I don't understand ), It's hard to find . The problem is that ,cac ...

  4. Why attitude is more important than IQ

    original text :http://www.businessinsider.com/why-attitude-is-more-important-than-iq-2015-9?IR=T& LinkedIn I ...

  5. Maven pack Jar

    present situation The project uses Maven, And introduced Spring, Include code . The configuration file .Jar package , It uses IDEA As a development tool , The output of the project is to be packaged into a workable Jar package . adopt IDEA You can also package successfully , only ...

  6. Elasticsearch Create and modify index structure

    Starting from the problem , This article can solve the following problems : One : How to turn on and off Es Indexes ( database )? Two : How to create an index ( database ) structure ? 3、 ... and : How to add an index to an existing index ( database ) Add type ( surface ) structure ? Four : How to transfer to an existing type ( surface ) Add new ...

  7. Day8--------------RPM Package management

    nginx.tar.gz: Source code , Compilation and installation RPM:redhat package manage, Binary system increase . Delete . check 1. increase package------>ls|less------------> ...

  8. Win10 Solve the problem of not being able to access other machine shares

    Win10 Solve the problem of not being able to access other machine shares     You can't access this shared folder , Because your organization's security policy prevents unauthorized guests from accessing . These strategies can help protect your computer from unsafe or malicious devices on the network . As an administrator ...

  9. hackerrank answer

    regex: https://github.com/taiyang-li/hackerrank/tree/master/hackerrank/regex-exercise awk: https://g ...

  10. Centos75 install postgresql11

    Switch to root Account , # install yum  Source yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_6 ...