Record the problems encountered during the php interview here _ PHP Tutorial

Source: Internet
Author: User
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...

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.