In PHP, arrays are divided into two types: Numerical index arrays and associated arrays.
The numeric index array is the same as the array in C language. The subscript is 0, 1, 2...
The subscript of the correlated array may be of any type, which is
Recently, I made a voting system for the entertainment portal, which is also overwhelmed by votes. All available methods are used. However, they are not ideal. Finally, I figured out the following method and made a flowchart to share with you.
If
The main function is file_get_contents. The main program is divided into two sections. Come with me and read it. (For the original code of the mortal blog, please note it ).
Copy codeThe Code is as follows: function escape ($ str ){
Preg_match_all ('
Copy codeThe Code is as follows: // PHP full-site anti-injection program, which must be included in the public file require_once
// Determine the magic_quotes_gpc status
If (@ get_magic_quotes_gpc ()){
$ _ GET = sec ($ _ GET );
$ _ POST = sec ($ _
Mind Map
Index:Ø Move Method (shift function) Ø Move Field (shift value Field) Ø Extract Class (Extract Class) Ø Inline Class (concatenate Class, is to merge the current class to other classes.) Ø Hide Delegate (hiding the Delegate relationship) Ø
The database leakage of various website account information at the end of last year was awesome. I also downloaded several databases to prepare data analysts to analyze the account information. Although the data information has been "organized", it
Usage
Copy codeThe Code is as follows: $ mysql = new sqlstr ("table1 ");
$ Mysql-> set ("name", "value ");
$ Mysql-> set ("name", "1", true );
Echo $ mysql-> insertSql ();
Copy codeThe Code is as follows: class sqlstr{Private $ param = array
Introduction
For php performance problems, the _ autoload () method is the most widely discussed method. Many people have mentioned that this method has a great impact on performance. Some people say that opcode can also affect the _ autoload ()
To remove the BOM, place the tool. php file in the attachment to the target directory and access tool. php in the browser!
Copy codeThe Code is as follows: // This file is used to quickly test whether the UTF-8 encoded file is added with BOM and can
There are seven magic constants whose values change with their positions in the code. For example, the value of _ LINE _ depends on the rows in the script. These special constants are case-insensitive, as follows:
Name
Description
1. Use HTTP header information
That is, use the php header function. The HEADER function in PHP is used to send control commands that should have been specified by the HTTP protocol to the browser through the WEB server. For example, to declare the
That is, the 13 PHP coding habits listed in this article. If you have better suggestions, you are welcome to post them in the comments below this article. I like to learn.
1. When using select to query information from the same database, use a join
Copy codeThe Code is as follows: /*************************************** *****
*
* Function name: curl_string ($ url, $ proxy)
* For Use: Check the proxy IP Address
* Author: Li feilin
* Date: 2011-11-09
*
**************************************** **
Go directly to the code!
Copy codeThe Code is as follows: /*
* Insert sorting (one-dimensional array)
* Each time, a data element to be sorted is inserted to an appropriate position in the sorted sequence to make the sequence still orderly until all
First, ajax was unable to upload files, which misled me for a while. If I couldn't sleep tonight, I followed the instructions to upload a new file without refreshing.
In fact, the principle is very simpleCopy codeThe Code is as follows:
Compared
Copy codeThe Code is as follows: /****** Back up the database structure ******/
/*
Function Name: table2sql ()
Function: converts the table structure to SQL
Function parameter: $ table: name of the table to be extracted
Return Value: return the
Copy codeThe Code is as follows: // Add ob_start () to your start ();
Ob_start ();
// The following is your code// Add ob_end_clean () to the end and output this page to a variable.$ Temp = ob_get_contents ();Ob_end_clean ();
// Write a file$ Fp =
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