With CodeIgniter also has a period of time, has not done what summary. Now summarize some of the CodeIgniter Operation database table optimization, although not all, but also really can help those who have just started CI students.
Link
Online There are many CodeIgniter database operation, here to do a summary.
Copy CodeThe code is as follows://query:$query = $this->db_query ("SELECT * from table");==================================Result () returns an array of objects$data =
Namespaces Overview
In PHP, namespaces are used to solve two types of problems encountered when writing a class library or application to create reusable code such as classes or functions:
User-written code conflicts with the name of a
Recently in the blog, but a variety of blog synchronization between the trouble, fortunately, each blog has its own RSS aggregation system, can be implemented through RSS blog call, so that their own hands-on RSS blog to achieve synchronization, in
Assetic is a PHP resource management framework for merging and compressing CSS/JS resources.
The sample code is as follows:
Copy CodeThe code is as follows:
Use assetic\asset\assetcollection;
Use Assetic\asset\fileasset;
Use
Sometimes in order to achieve a certain purpose, we need to sort the two-dimensional array, and now share the method of its implementation.
Copy CodeThe code is as follows:
$arr =array (
' 1 ' = = Array (' Date ' = ' 2011-08-18 ', ' num ' = 5),
' 2
Using exceptions
PHP5 adds an exception handling module similar to other languages. Exceptions generated in PHP code can be thrown by a throw statement and captured by a catch statement. Code that requires exception handling must be placed inside a
Read a long time data structure but not how to use, in the Internet to see the data structure about PHP, learning a bit, and share with you. The last time I shared the "PHP small tutorial implementation linked list," This time to add a doubly linked
the component mechanism of YII
Component mechanism is the essence of the whole system of Yii, before using Yii, it is most important to understand its component mechanism, if you do not understand this mechanism, then reading Yii Source code will
Thinkphp itself has a valid method of generating a static page, which is illustrated in the Manual of Tp2.0, which is not stated in the 3.0 manual, but the 3.0 method still exists. )
$this->buildhtml (' Static file ', ' Static path ', ' template
-----------------------------------------------------------------------------------------------
The Data URI scheme is a URI scheme (Uniform Resource Locator mode).
Our well-known site reference resource files are similar to
Currently, the three most commonly used dynamic web languages are: ASP (Active Server pages), PHP (hypertext Preprocessor), and JSP (Java Server Pages).
Both JSP and ASP are programs that can be embedded in HTML, but they are fundamentally
1, if the method of the class can be defined as static, as far as possible to define as static, it will increase the speed of nearly 4 times times.
2. The speed of $row [' ID '] is 7 times times that of $row[id].
3. Echo is faster than print, and
As one of my favorite functions, I finally found the devil of this function today. Voluminous wrote the following code, local testing everything OK, to the server on the SB.
Copy CodeThe code is as follows:
if (strlen ($PASSWD) Do something
}
The
Phpanalysis is currently widely used in Chinese parts of speech, using reverse matching pattern word segmentation, so compatible with a wider range of coding, now its variables and common functions are described below:
First, the more important
The general use of file-mode caching is sufficient, and thinkphp also provides a fast caching method, specifically for file mode, F method.
Because
using the PHP return method, so its efficiency is higher than the S method。
The F method has the
The extract function is used to decompose a number into multiple variables directly, and the following is the explanation of the user: the PHP extract () function imports variables from the array into the current symbol table. For each element in
Financial people have encountered such a problem, such as 13,126.8 Yuan, in the invoice or other bookkeeping business, generally use uppercase to spell "one Wan bai Lu Yuan ba corner of the whole".
This is not, also affixed to my original in the
In the UNIX series with \ n
In Windows series with \ r \ n
On Mac with \ r
PHP can be replaced with Php_eol to improve code-level portability
For example:Copy the Code code as follows:Echo Php_eol;The Windows platform is equivalent to echo "\ r \
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