First of all, why not build apache,php and MySQL environment separately? So that you can learn more knowledge, and say it is more cool. But maybe because I am lazy, I am the kind of "since there are ready, use is the" person. A gentleman is born non-
Copy CodeThe code is as follows:
Iconv (' GBK ', ' utf-8//ignore ', ' home of the script '); Converts a string from GBK encoding to UTF-8 encoding
However, Iconv can only solve the pre-known encoding situation, if the string encoding is unknown,
Note: $c = new Cdbcriteria (); is a activerecord notation that makes ActiveRecord more flexible than the manual DAO (PDO) and query Builder.
Here are some notes and common uses of Yii Cdbcriteria:
one the SQL assembly situation
$criteria =
When you write code today, you need to use the Json_decode function, and find that the previous version of php5.2 does not integrate this function, but we can do it through a custom function.
Copy the Code code as follows:function Json_decode2
Json_encode ()
This function is primarily used to convert arrays and objects into JSON format.
Copy the Code code as follows:$arr = Array (' a ' = = ' A ', ' B ' = ' B ', ' c ' = ' C ', ' d ' = ' d ', ' e ' = ' e ');echo Json_encode ($arr);
Output
Usually the position of php.ini in:
Copy CodeThe code is as follows:/etc directory or under the/usr/local/lib directory.
If you still can not find php.ini or find the php.ini changes do not take effect (in fact, did not find the right), please use
an Nginx 504 Gateway time-out error troubleshooting, resolve the record, after repeated inspection, found that the cause of this problem is that PHP curl does not set a time-out, the solution as long as the setting time-out or modify Nginx
PHP Export CSV format data implementation:
Define a string to store the contents, for example
$exportdata = ' rule 111, Rule 222, Trial 222, Regulation 222, service 2222, rule 1, Rule 2, Rule 3, match character, set time, validity period '. \ n
-----------------------------------------------------------------------------------------------
First go to ueditor official website to download the corresponding version: http://ueditor.baidu.com/website/download.html
Here to 1.4.2 PHP version,
Blog Park markdown Editor too @!!! Never mind. No format!!!
/********************** Curl Series ***********************///get data directly via curl (including post, header, etc.)/* $url: If non-array, then HTTP; array , then HTTPS * $header:
To deal with this problem, a study has found that there are 2 ways:
Method One:
Find PHP.ini Search These 3 places upload_max_filesize, Memory_limit and Post_max_sizeIt would be nice to change the value behind them to larger than the size of the
First, we introduce the functions used:
Copy the Code code as follows:Mb_strwidth ($STR, $encoding) returns the width of the string$str the string to evaluate$encoding the encoding to use, such as UTF8, GBK
Copy the Code code as
If you want to produce the perfect product, it must be tested in all aspects. There are several types of tests, each of which is specific to a particular aspect of the application.
This article will introduce the unit test, database test, System
Let's look at how to implement a custom iterator and then begin to understand how the iterator works internally. Let's take a look at an official example:
Position = 0; } Function Rewind () { var_dump (__method__);
the role of is_subclass_of:
Copy the Code code as follows: BOOL Is_subclass_of (Object object, String class_name)Returns TRUE if the object owning class is a subclass of class class_name, otherwise FALSE is returned.Note: from PHP 5.0.3 You can
To cite a case:
Copy CodeThe code is as follows:
Class Downfile {function Downserver ($file _name) {$file _path = "./img/". $file _name;transcoding, file name to gb2312 solve Chinese garbled$file _name = Iconv ("Utf-8", "gb2312", $file
1. Detect if Apache supports Mod_rewrite
Using PHP's Phpinfo () function to view the environment configuration, through Ctrl+f find to "Loaded Modules", which lists all the Apache2handler has been opened module, if it includes "mod_rewrite", it is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service