search
HomeBackend DevelopmentPHP Tutorial2013 Civil Service Interview Questions PHP Interview Questions Collection

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.

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
The Continued Use of PHP: Reasons for Its EnduranceThe Continued Use of PHP: Reasons for Its EnduranceApr 19, 2025 am 12:23 AM

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python: Exploring Their Similarities and DifferencesPHP and Python: Exploring Their Similarities and DifferencesApr 19, 2025 am 12:21 AM

PHP and Python are both high-level programming languages ​​that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP and Python: Different Paradigms ExplainedPHP and Python: Different Paradigms ExplainedApr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP and Python: A Deep Dive into Their HistoryPHP and Python: A Deep Dive into Their HistoryApr 18, 2025 am 12:25 AM

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

Choosing Between PHP and Python: A GuideChoosing Between PHP and Python: A GuideApr 18, 2025 am 12:24 AM

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP and Frameworks: Modernizing the LanguagePHP and Frameworks: Modernizing the LanguageApr 18, 2025 am 12:14 AM

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHP's Impact: Web Development and BeyondPHP's Impact: Web Development and BeyondApr 18, 2025 am 12:10 AM

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

How does PHP type hinting work, including scalar types, return types, union types, and nullable types?How does PHP type hinting work, including scalar types, return types, union types, and nullable types?Apr 17, 2025 am 12:25 AM

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values ​​and handle functions that may return null values.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)