This article shares several PHP programmer interview questions, with a total of 6 parts. It is suitable for PHP friends who are looking for a job. Come and refer to it.
Topic recommendation: PHP interview questions and answers
Interview question 1 1. Use PHP to print out the time of the previous day in the format of 2006-5-10 22:21:21 2. The difference between echo(), print(), and print_r() 3. Templates that enable HTML and PHP to be used separately 4. How to realize PHP and JSP interaction? 5. What tools are used for version control? 6. 6. How to implement string flipping? 7. Methods to optimize mysql database. 8. Talk about transaction processing 9. How to achieve maximum load using apache+mysql+php 10. A method to intercept Chinese text strings without garbled characters. Interview question 2 var $empty = ''; var $null = NULL; var $bool = FALSE; var $notSet; var $array = array(); 1. $a = "hello"; $b = &$a; unset($b); $b = "world"; what is $a? 2. $a = 1; $x = &$a; $b = $a++; what is $b? 3. $x = empty($array); what is $x? true or false 4.Have you ever used version control software? If so, what is the name of the version control software you used? 5.Have you ever used a template engine? If so, what is the name of the template engine you used? 6. Please briefly describe your most proud development work. 7. For websites with large traffic, what methods do you use to solve the traffic problem? 8. Use PHP to write the code to display the client IP and server IP: Interview question 3 1. PHP/MySQL programming 1) In a content management system, the message table has the following fields: id article id title article title content article content category_id article classification id hits clicks Create the above table and write the MySQL statement 2) The same content management system as above: The table comment records the content of user replies. The fields are as follows: comment_id reply id id article id, associated with the id comment_content in the message table. The reply content now needs to be obtained by querying the database to obtain the article title list in the following format, and according to the number of replies Sort, the one with the highest reply is at the top. Article id. Article title. Number of clicks. Number of replies. Use a SQL statement to complete the above query. If the article has no reply, the number of replies will be displayed as 0. 3) In the above content management system, the category table stores classification information. The fields are as follows category_id int(4) not null auto_increment; category_name varchar(40) not null; When the user enters an article, select the article category by selecting the drop-down menu. Write how to implement this drop-down menu 2. PHP file operation 1) The above content management system: after the user submits the content, the system generates a static HTML page; write down the basic ideas for implementation 2) Briefly describe the implementation process and basic ideas for users to modify to publish content. 3. PHP program 1) Write the output of the following program $c?4:5; echo $a; ?> 2) Write the output results of the following program Interview question 4 1. Short answer questions 1. Please explain the difference between passing by value and passing by reference in PHP. When to pass by value and when to pass by reference? 2. What is the function of error_reporting in PHP? 3. Please write a function to verify whether the format of the email is correct 4. Briefly describe how to obtain the current execution script path, including the obtained parameters. Note: For example, there is a script bbs.it-home.org. The parameters passed to it are parameter 1, parameter 2, parameter 3.... The method of passing parameters may be GET or POST, so now please write something like http://bbs.it-home.org/script.php? Parameter 1=value 1¶meter 2=value 2.....The result 5. How to modify the survival time of SESSION. 6. There is a web page address http://bbs.it-home.org/xxx.php. How to get its content? 7. There is a one-dimensional array that stores integer data. Please write a function to arrange them in order from large to small. High execution efficiency is required. and explain how to improve execution efficiency. (This function must be implemented by yourself, you cannot use PHP functions) 8. Please give an example of what methods you use to speed up page loading during your development process. 2. Database design questions: Please design a database table structure for the library book borrowing management system; it can record basic user information, book information, and borrowing and returning book information; the number of data tables should not exceed 6; please draw a table to describe the table structure (need to explain each Field name, field type, field meaning description of the field); in database design, you should: 1. Ensure the uniqueness of each user; 2. Ensure the uniqueness of each book; each book corresponds to multiple books with different numbers; ensure the uniqueness of each book; 3. In the book borrowing information table, both borrowing and returning behaviors should be considered, as well as the borrowing period; 4. Ensure the referential integrity between the borrowing information table, the user table, and the book information table; 5. Limit the maximum number of books each user can borrow 6. If a new user registers or a new book is added to the library, its unique identifier is guaranteed to be automatically generated. 7. Provide support for the following series of report requirements: (No specific instructions, no need to write implementation statements, but in the database design, ensure that these reports can be implemented with at most one SQL statement) a) Daily statistical report: report on the number of books borrowed on the same day and the number of books returned on the same day; b) Real-time reports: i. The current number of borrowed books and the number of borrowable books for each type of book; ii. The list of all overdue books and users in the current system and the number of overdue days iii. The number of books borrowed by all users in the current system, divided by user List (including users who have not borrowed books); please write SQL statements to achieve this requirement: Database application: Please write a series of SQL statements to describe the complete borrowing behavior and return behavior; and ensure that this series of The next question on the execution integrity of SQL statements is the most important test of ability. If you cannot complete it, we will not be able to give a judgment result! So please write a detailed answer and ensure that the answer is an executable program. Send the results via email to your mailbox within two days. Combined with your design in the second question, use a database to implement it. It is required to use a three-layer structure or a multi-layer structure, and it is required to use object-oriented thinking for programming. If possible, design A set of template mechanisms to achieve this. Features: List the current status of borrowed books, sort the numbers by date, user name, title, number, borrowing date of the book 1. Zhang Jin Dyefang 12576587 2004-9-1 2. Liu Xing’s Journey to the West 32131098 2004-9-2 Interview question 5 1. In PHP, the name of the current script (excluding the path and query string) is recorded in the predefined variable (1); and the URL linking to the current page is recorded in the predefined variable (2). 2. The execution program segment will output (3). 3. In HTTP 1.0, the meaning of status code 401 is (4); if a "File not found" prompt is returned, the header function can be used, and its statement is (5). 4. The function of array function arsort is (6); the function of statement error_reporting(2047) is (7). 5.The database connection string format in PEAR is (8). 6. Write a regular expression to filter all JS/VBS scripts on the web page (that is, remove the script tag and its content): (9). 7. Install PHP as an Apache module. In the file http.conf, first use statement (10) to dynamically load the PHP module, and then use statement (11) to make Apache process all files with the extension php as PHP scripts. . 8. Both statements include and require can include another file into the current file. The difference between them is (12); in order to avoid including the same file multiple times, you can use statement (13) to replace them. 9. The attributes of the class can be serialized and saved to the session, so that the entire class can be restored later. The function to be used is (14). 10. The parameter of a function cannot be a reference to a variable unless (15) is set to on in php.ini. 11.The meaning of LEFT JOIN in SQL is (16). If tbl_user records the student's name (name) and student number (ID), tbl_score records the student's (some students were expelled after the exam and there is no record of them) student number (ID) and test scores (score) as well as test subjects (subject), if you want to print out the name of each student and the corresponding total score of each subject, you can use SQL statement (17). 12. In PHP, heredoc is a special string, and its end mark must be (18). 13. Write a function that can traverse all files and subfolders in a folder. 14. Briefly describe the implementation principle of unlimited classification in the forum. 15. Design a web page so that when it is opened, a full-screen window pops up with a text box and a button in the window. After the user enters information in the text box and clicks the button, the window can be closed, while the entered information is displayed on the main web page. Interview question 6 There is a table menu(mainmenu, submenu, url). Please use recursive method to write a tree menu and list all menus. Interview question 7 1- You are given three numbers and write a program to find their maximum value. 2- Talk about the advantages and disadvantages of asp, php and jsp 3- Talk about your understanding of mvc 4- Write the SQL of the names of the ten people with the most posts, using the following table: members(id,username,posts,pass,email) Interview question 8 1-How to determine whether a window has been blocked through javascript. 2-Write the running mechanism of session 3-There is an array $a=array(4,3,8,9,2); please reorder it and list it in order from small to large. 4-To prevent SQL injection vulnerabilities, the _____ function is generally used. 5-Query the number of people online and handle abnormal disconnection SQL....WHERE ________ |