Home  >  Article  >  Backend Development  >  PHP interview questions for intermediate level programmers

PHP interview questions for intermediate level programmers

WBOY
WBOYOriginal
2016-07-25 08:59:28696browse
An interview question for intermediate-level PHP programmers, to test whether PHP developers have reached the intermediate level, including PHP and JavaScript, etc. Friends in need, please refer to it.

If you are familiar with all of the following content, it means that you basically have an intermediate level of PHP development, and you can generally go for an interview for the so-called senior PHP development engineer position.

It does not include knowledge of css, xml, etc., nor does it include knowledge of network technology, just php and javascript.

1: How many years have you been writing PHP? What does the name PHP mean? 2: Are you familiar with javascript? What is ajax (Asynchronous javascript and XML) and what does it do? Can you briefly explain the principle of Google Maps? 3. Is it used in firefox? There are usually development-related plug-ins? How to debug javascript? 4: What JavaScript framework are you familiar with? Have you heard of jquery? What does it do? A div, the class is "aa bb cc", the id is "nodesView", so how to get the jquery object of this div? And directly get the dom of this div Object, how to obtain it? How to convert dom object into jquery object?

How to convert dom objects into jquery objects Ordinary DOM objects can generally be converted into jQuery objects through $(). For example: $(document.getElementById("msg")) is a jquery object, and you can use jquery methods. Since the jquery object itself is a collection. Therefore, if the jquery object is to be converted into a dom object, one of the items must be retrieved, which can generally be retrieved through an index. For example: $("#msg")[0], $("div").eq(1)[0], $("div").get()[1], $("td")[5 ] These are dom objects, and you can use methods in dom, but you can no longer use Jquery methods. The following ways of writing are all correct: String 8$(“#msg”).html();

$(“#msg”)[0].innerHTML; $(“#msg”).eq(0)[0].innerHTML; $("#msg").get(0).innerHTML;

5 Regarding the browser interaction process: There is a form on the page. What does action mean? What does method mean? If the method is get, how will the data of a form be transmitted to the server? If the script on the server is php, then how does php get this? Form data? Where’s the post?

6 What are the commonly used methods of connecting to the database in PHP? Are you familiar with pdo? If there are some filters in a query, that is, some parameters after where, how to bind them?

7 What is the difference between single quotes and double quotes in php? With $a = 1, what is echo “‘$a’”? There is $b = array(’1′,’2′,’3′) So echo “‘$b[1]‘”? How to write the content that can output the first element?

8 How to get the name (path) of the current script?

$_SERVER['PHP_SELF'];

9 How to determine whether there is a certain element in the array, such as determining whether there is a key method in $a = array()?

isset($a['method']),array_key_exists('method',$a)

10 Object-oriented Objects have two aspects: member variables and methods. In a compiled language (such as Java), if you try to call a non-existent method or reference a non-existent member variable, you will get a compile-time error. But what happens in a non-compiled language like PHP? Method calling in PHP works like this. First, the PHP interpreter looks for methods on the class. If the method exists, PHP calls it. If not, then the magic method __call on the class is called (if this method exists). If __call fails, the parent class method is called, and so on.

Magic method Magic methods are methods with specific names that the PHP interpreter looks for at specific points in script execution. The most common magic method is the constructor called when the object is created. The __call method takes two parameters: the name of the requested method and the method parameters. If you create a __call method that accepts these two arguments, performs some function, and returns TRUE, then the code that calls the object will never know the difference between the coded method and the method handled by the __call mechanism. In this way, it is possible to create objects that dynamically simulate situations with numerous methods. In addition to the __call method, other magic methods - including __get and __set - are called because they refer to non-existent instance variables. With this concept in mind, you can start writing dynamic database access classes that can adapt to any table.

11 What is mvc? What are its advantages and disadvantages? Are you familiar with PHP framework? Are you familiar with PHP templates? Smarty!

12 Well-known php cms, can you name a few?

13 Name a few Linux distributions? Which one is the most commonly used? Why do you like to use this distribution? What is the package management tool?



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