PHP development engineer interview test

Source: Internet
Author: User
PHP development engineer interview test
1. what is object-oriented? What are the main features? Surface object is a kind of elegant means to directly map objects and concepts in nature to the program World. main features: abstraction, inheritance, encapsulation, and polymorphism 2. what is the difference between a SESSION and a COOKIE? please refer to the protocol, the reasons for its occurrence and the description of its role? Session is a solution for the server to save the client status information. it is generally stored in the server memory, and the session timeout time is set on the server. Cookie is a solution for saving information on the client. it is generally saved as a file, and the cookie clearing time is set in the client browser. 3. What are the meanings of codes 302, 403, and 500 in HTTP status? 302: the temporary transfer is successful. the request content has been transferred to the new location. 403: access prohibited. 500: Internal Server Error. 4. create a compressed package in Linux and decompress the compressed package command. Tar-cvf demo.tar demoTar-xcf demo.tar 5. write the meaning of the data type (int char varchar datetime text). What is the difference between varchar and char? Int integer char fixed-length character Varchar variable-length character Datetime date Text type Varchar and char difference char is a fixed-length character type, how much space is allocated, how long space is occupied. Varchar is a variable-length character type. it can effectively save space when the content is large. Because the varchar type is variable, when the data length changes, the server must perform additional operations, so the efficiency is lower than that of the char type. 6. What are the basic differences between MyISAM and InnoDB? The MyISAM type does not support advanced processing such as transaction processing, whereas the InnoDB type does. MyISAM tables emphasize performance, which is faster than InnoDB, but do not support transactions. InnoDB provides advanced database functions such as transaction support and external keys. 7. no cookie is used to send a cookie to the client. understanding: when session_start () is enabled, a constant SID is generated. when the COOKIE is enabled, this constant is null. when the COOKIE is disabled, the PHPSESSID value is stored in this constant. Add a SID parameter after the URL to pass the SESSIONID value, so that the values in the SESSION can be used on the client page. When the COOKIE is enabled on the client and the SESSION is enabled on the server. For the first request from the browser, the server will send a COOKIE containing SESSIONID to the browser. when the browser sends the second request, it will submit the existing COOKIE together to the server. 10. difference between isset () and empty (). the result of judging different data is $ a = 0; $ a = '0'; $ a = ''; $ a = false; $ a = null; Isset () determines whether it exists. if it exists, it is true no matter whether it is false. Empty () determines whether it is null. if it is null, it is a true value. if it does not exist, it is also a true value. Isset (): true; falseEmpty (): true; true12. how to pass variables between pages (at least two methods )? Get, post 3, PHP code question 1. write the regular expression that matches the URL. /^ [a-zA-z] +: \/(\ w + (-\ w + )*)(\. (\ w + (-\ w + )*))*(\? \ S *)? /2. write out common sorting algorithms and use PHP to perform bubble sorting. sort the array $ a = array () in ascending order. $ Arr = array (233,5, 6,75454, 32); Mao ($ arr); Function mao ($ arr) {$ n = count ($ arr ); for ($ I = 0; $ I <$ n; $ I ++) {For ($ j = $ n-1; $ j> 0; $ j --) {If ($ arr [$ j-1]> $ arr [$ j]) {$ t = $ arr [$ j-1]; $ arr [$ j-1] = $ arr [$ j]; $ arr [$ j] = $ t ;}}} 3. student is a table in the test Database. The field is name, class, and score. Name, class, and score respectively. 1) the students in each class are sorted in descending order of their scores. 2) the number of passing students and the number of failing students in each class are listed in the following format: class, number of passing students, and number of failing students; 3) use PHP to write data to the connected database ("localhost", "msuser", "mspass"), execute the preceding SQL statements, display results, identify errors, and close the database; 1) SELECT * FROM student order by score desc;
 
Related Article

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.