The problems encountered during the php interview are recorded here. Code Optimization copy code: for ($ i0; $ i8; $ I ++) {array_push ($ week, $ arr);} copy the code as follows: for ($ i0; $ i8; $ I ++) {$ week [] $ arr [$ I] ;}then no function code optimization is called.
The code is as follows:
For ($ I = 0; $ I <8; $ I ++ ){
Array_push ($ week, $ arr );
}
The code is as follows:
For ($ I = 0; $ I <8; $ I ++ ){
$ Week [] = $ arr [$ I];
}
// This eliminates the extra burden of calling a function.
Benefits and disadvantages of indexing
Benefit: when querying, the system first locates the number of rows of a specific value in the index list, greatly reducing the number of rows that match the traversal.
Disadvantage: no matter how you query this table, it does not make sense to increase the index because there are a large number of duplicate values in the field.
If there are few records, increasing the index will not lead to speed optimization, but will waste storage space, because the index requires storage space, in addition, each execution of update, insert, or delete requires re-calculation of the index of the field.
The authorization code is as follows: for ($ I = 0; $ i8; $ I ++) {array_push ($ week, $ arr);} the code is as follows: for ($ I = 0; $ i8; $ I ++) {$ week [] = $ arr [$ I] ;}// in this case, no function call is available...