PHP classic interview questions set
The content of this article is about the PHP classic interview question set. The PHP classic interview question set has a certain reference value. Now I share it with you. Friends in need can refer to it.
Related recommendations: " 2019 PHP interview questions summary (collection)》
Based on my own interview situation in the past few days, I listed some of the PHP interview questions I faced, basically based on my own Please point out any inaccuracies and discuss and analyze with everyone. I also hope it can help those who are interviewing:
1. The similarities and differences between Get and Post in form submission Click
get request is generally used to obtain data from the server, and post is generally used to submit data to the server.
The parameters transmitted by get are in the url, and there is a limit on the size of the parameters passed. There is no size limit for post.
Get is unsafe, post is more secure than get
Get requests are accepted on the server side using Request.queryString, post requests are accepted on the server side using Requset.form
2.What is the base tag of HTML used for?
Must be written in the head. The base tag specifies the default address or default target for all links on the page
3.echo(), What is the difference between print() and print_r()?
echo is a PHP statement, print and print_r are functions, statements have no return value, and functions can have return values (even if they are useless)
Print() can only Print out the value of simple type variables (such as int, string)
print_r() can print out the value of complex type variables (such as array, object)
echo Output one or more strings
4. Write a regular expression for email
1 |
|
5. Convert the array ['a', 'b', 'c'] into the string 'abc'
1 2 3 |
|
6 .Get the position where A first appears in the string 'aAbB'
1 2 |
|
7. Write a paragraph to completely reverse the string with minimal cost, e.g. Convert "1234567890" into "0987654321". (Use the above you Write and mark simple comments in the most familiar language, do not use functions,
1 2 3 4 5 6 7 8 |
|
8. Please use recursion to implement a factorial evaluation algorithm F(n): n=5;F(n)=5!=5 *4*3*2*1=120
1 2 3 4 5 6 7 |
|
9. Convert the character length fang-zhi-gang into camel case format: FangZhiGang
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
10. The built-in sorting methods for arrays are Which ones?
1 2 3 4 5 6 7 8 |
|
11. Use PHP to write the code to display the client IP and server IP
1 2 |
|
12. What is the difference between the include and require statements? To avoid including the same file multiple times, you can use ( ?) statement to replace them?
1 2 3 4 5 |
|
13.The difference between session and cookie?
1 2 3 |
|
14.PHP exchanges the values of two variables without using the third variable
1 2 3 4 5 6 7 8 |
|
15. Write a method to get the file extension
1 2 3 4 5 6 |
|
16. Use PHP to print out the time of the previous day in the format of 2017-3-22 22:21:21
1 |
|
17.What security should be considered for sql statements?
1 2 3 |
|
18.Optimizing mysql database methods
1 2 3 4 5 |
|
19.For a website with large traffic, what method will you use to solve the traffic problem?
1 2 3 4 5 6 |
|
20.What is the difference between mysql_fetch_row() and mysql_fetch_array?
1 2 3 |
|
1 |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
|
22.What are the mysql database engines?
1 |
|
23. Talk about your understanding of the difference between MyISAM and InnoDB in the mysql engine?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
24. The difference between redis and memache cache
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
25. There are three columns A B C in the table, which are implemented using SQL statements : When column A is greater than column B, select column A; otherwise, select column B; when column B is greater than column C, select column B; otherwise, select column C.
1 2 3 4 5 6 7 8 9 10 |
|
26. When installing a Linux system, use the netconfig program to configure the network. What content should be entered?
1 |
|
27. How to write an interface in PHP for others to call?
1 2 3 4 5 6 7 8 9 10 11 12 |
|
28. Use the PHP header() function to implement the page 404 error prompt function
1 |
|
29.heredoc structure and usage
1 2 3 4 5 6 7 8 |
|
1 |
|
1 2 3 4 5 |
|
31.javascript Program code to determine whether the pop-up window is blocked
1 2 |
|
32. Functions used for PHP serialization and deserialization
1 2 3 |
|
33. Use the following table structure to write the SQL statement of the names of the ten people with the most posts (members(id,username,posts,pass,email)
1 |
|
34,. To install PHP as an Apache module, first use the statement (?) in the file http.conf to dynamically load the PHP module, and then use the statement (?) to make Apache add all extensions to php files are processed as PHP scripts.
1 2 3 |
|
35. What are the transactions in the database?
1 |
|
1 |
|
1 |
|
1 |
|
1 2 3 4 5 6 7 8 9 |
|
1 2 |
|
1 2 3 4 5 |
|
39.在PHP中,当前脚本的名称(不包括路径和查询字符串)记录在预定义变量(?)中;而链接到当前页面的URL记录在预定义变量(?)中。
1 2 |
|
40.一个函数的参数不能是对变量的引用,除非在php.ini中把(?)设为on.
1 |
|
今天就先写到这里吧!在后期的面试中遇到不同的面试题,我在编辑到此处,希望此文会给大家带来帮助,觉写的不错的,对你有帮助中的请动动你的手关注我和点赞分享,祝愿正在找工作的你,能找一份满意的工作。祝你新的旅途愉快!
相关推荐:
The above is the detailed content of PHP classic interview questions set. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7
