1. Indicate the author and key algorithm computing processes at the head of the original ecological code or class.
For example
/**
* @ Author zengmoumou
* Function: obtains the operator, province, city, and county corresponding to the ip address based on the ip address list.
*/
2. Use a combination of English words as much as possible. The first is lowercase and the last is uppercase.
For example:
$ ConfTreeModel = D ("ConfTree ");
3. Use a combination of English words as much as possible for the function name. The first one is in lowercase and the last one is in uppercase.
For example:
Function searchRealServer ($ keyword)
4. It is best to write the author, variable, and algorithm of the function above the function.
For example:
/**
* @ Author zengmoumou
* Obtain the search result vswitch
* Enter description here...
* @ Param unknown_type $ allIds
*/
Private function getSwitchsInIds ($ allIds ){
5. The function should not exceed 100 rows. If the number is exceeded, split the function as needed.
6. independent functional Original Ecological Code is best divided into configuration pages, function pages, and business pages.
For example, a small development that reads the database for summary.
Can be divided
Config. php configuration page [write database configuration, etc]
Function. php function page [write various function-independent functions, such as reading data functions, constructing report functions, and sending email functions]
StatWeekData. php business page [reference the configuration page and function page, and call and process various function functions in turn to process the business logic]