Home  >  Article  >  Backend Development  >  Common PHP interview questions and answering techniques in 2017

Common PHP interview questions and answering techniques in 2017

小云云
小云云Original
2017-11-11 10:10:031672browse

Are you new to society and looking for a job soon? Are you nervous every time you face those PHP interview questions? In response to these PHP interview questions, the editor has carefully compiled the 12 most frequently asked PHP interview questions and the corresponding conventional answers for everyone. I hope it will be helpful to everyone.

1. Question: Please tell me in the simplest language what php is?

Answer: The full name of php: hypertext preprocessor, which is a server scripting language used to develop dynamic websites.

2. Question: What is mvc?

Answer: mvc consists of model, view and controller. PHP mvc can manage it more efficiently 3 different layers of php code.

model: Data information access layer.

view: The view layer is responsible for displaying application data on the interface in a specific way.

controller: Usually the controller is responsible for reading data from the view, controlling user input, and sending data to the model.

3. Question: How many ways are there to reference css in the page?

Answer: There are 3 ways to use css in the page:

Referencing external css files

Internally defined style style

Inline style

4. Question: Does PHP support multiple inheritance?

Answer: No. A PHP class can only inherit one parent class and is identified with the keyword "extended".

5. Question: What is the difference between echo and print in php?

The two look very similar because they both print some values ​​on the screen. superior. But the essential difference between echo and print is that echo is used to output a string, and multiple values ​​can be separated by commas when displaying them. Only basic types are supported. Print can not only print string values, but also print function return values.

6. Question: What is the difference between the get and post methods?

Answer: The form information we fill in on the web page can pass the data to the server through these two methods. When When we use the get method, all information will appear in the URL address, and the get method can only pass up to 1024 characters, so the get method can be used if the transmission volume is small or security is not so important. Speaking of the post method, up to 2MB bytes of data can be transferred and can be adjusted as needed.

7. Question: What is the method to get the image size in php?

Answer: getimagesize () Get the size of the image

imagesx () Get the width of the image

imagesy () Get the height of the image

8. Question: What is pear in php?

Answer: pear is the php extension and application library (php extension and application repository), which is a code repository for PHP extensions and applications.

9. Question: How to upload videos using php and mysql?

Answer: We can store the address of the video in the database without storing the real video data in the database. The video data can be stored in a specified folder on the server. The default upload size is 2mb, but we can also change it by modifying the max_file size option in the php.ini file.

10. Question: What are the error types in php?

Answer: There are roughly three types of errors encountered in php.

Tips: These are very normal messages, not major errors, and some will not even be displayed to the user. For example, access a variable that does not exist.

Warning: This is a serious error. A warning message will be displayed to the user, but it will not affect the output of the code, such as including some non-existent files.

Error: This is a really serious error, like accessing a non-existent php class.

11. Question: How to define constants in php?

Answer: Use define () in php to define constants.

define (“newconstant”, 30);

Question: How to submit the form without using the submit button?

12. Question: How to submit the form without using the submit button ?

If you don’t want to use the submit button to submit the form, you can use a hyperlink to submit it

Summary:

No one can say for sure about PHP interview questions, the above is still from 2017 Some of the more common interview questions. I hope you can understand what you need to know about these questions so that you can face the interview calmly and achieve good results.

Related recommendations:

The 10 most error-prone PHP interview questions

PHP core technology questions in PHP interview questions Share

A summary of written test questions in php interview questions

The most complete summary of php interview questions and answers in 2017

2017 recruitment season: Super summary of PHP interview questions!

The above is the detailed content of Common PHP interview questions and answering techniques in 2017. For more information, please follow other related articles on the PHP Chinese website!

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