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. Able to separate HTML and PHP Open the template for use
4. How to realize PHP and JSP interaction?
5. What tools are used for version control?
6. How to achieve string flipping?
7. Methods to optimize MYSQL database.
8. Let’s talk about transaction processing
9. How to achieve maximum load with apache+mysql+php
10. How to intercept Chinese 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, do you use version control? What is the name of the software?
5. Have you ever used a template engine? If so, what is the name of the template engine you have used?
6. Please briefly describe your most proud development work.
7. For websites with large traffic, you What method is used 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 table message There are the following fields
id article id
title article title
content article content
category_id article category id
hits clicks
Create the above table and write the MySQL statement
2) Same as the above content management system: table comment records user reply content, fields As follows
comment_id Reply id
id Article id, the id in the associated message table
comment_content Reply content
Now we need to get a list of article titles in the following format by querying the database, and sort them by the number of replies, with the highest reply at the top
Article id Article title Clicks Number of replies
Use a SQL statement to complete the above query. If the article has no replies, the number of replies will be displayed as 0
3) In the above content management system, the table category saves classification information, and the fields are as follows
category_id int(4) not null auto_increment ;
categroy_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: user submitted content Finally, the system generates a static HTML page; write down the basic ideas for implementation
2) Briefly describe the implementation process and basic ideas for user modification to publish content
3. PHP program
1) Write out the output results of the following program
$b=201;
$c=40;
$a=$b>$c?4:5;
echo $a;
?>
2) Write the output of the following program
$ str="cd";
$$str="hotdog";
$$str.="ok";
echo $cd;
?> The difference between passing by value and passing by reference. 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 get the current execution script path, including the obtained parameters.
Explanation: For example, there is a script www.domain.com, and 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
The result of http://www.domain.com/script.php? Parameter 1=value 1&Parameter 2=value 2....
5. How to modify the survival time of SESSION.
6.. There is a web address http ://www.domain.com/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 method you use to speed up page loading during your development process.
2. Database design questions:
Please design a database table structure for a library borrowing management system; it can record basic user information, book information, and borrowing and returning books; the number of data tables should not exceed 6; please draw a table Describe the table structure (the field name, field type, and field meaning description of each field need to be explained);
In database design, you should:
1. Guarantee 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 that 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 need to ensure that these reports can be implemented with at most one SQL statement in the database design)
a) Daily statistical report: borrowing books on the day Report on the number of copies and the number of books returned on the day;
b) Real-time reports:
i. The current number of borrowed books and the number of books available to borrow;
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 is listed by user (including users who have not borrowed books); please write a SQL statement to achieve this requirement:
Database application:
Please write a series of SQL statements to describe the complete The behavior of borrowing books and returning books; and ensuring the execution integrity of this series of SQL statements
The next question is the most important test of test ability. If it cannot be completed, 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 hr@88keke.com 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 template mechanism to implement it.
Function: List the current borrowed books, arranged by date
No. User name Title of book Number of book Borrowed date
1. Zhang Jin Dayanfang 12576587 2004-9-1
2. Liu Xing Journey to the West 32131098 2004- 9-2
...
Interview Question 5
1. In PHP, the name of the current script (excluding 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 Define variables in (2).
2. Executing the 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 treat all files with the extension php as PHP scripts. deal with.
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 infinite 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 recursion to write a tree menu and list all menus.
Interview Question 7
1- You are given three numbers, write a program to find their maximum value.
2- Talk about the advantages and disadvantages of asp, php, jsp
3- Talk about the understanding of mvc
4- Write the SQL of the names of the ten people with the most posts, use 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 out the operating 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
The above introduces the 2013 civil servant interview questions and PHP interview question set, including the content of the 2013 civil servant interview questions. I hope it will be helpful to friends who are interested in PHP tutorials.