For the PHP interview questions compiled by NLP, from basic to advanced, If you want to apply for a php job, refer. For more information, see
For the PHP interview questions compiled by NLP, from basic to advanced, If you want to apply for a php job, refer. For more information, see
PHP Basics
1. Evaluate the value of $
The Code is as follows:
$ A = "hello ";
$ B = & $;
Unset ($ B );
$ B = "world ";
Echo $;
2. Evaluate the value of $ B
The Code is as follows:
$ A = 1;
$ X = & $;
$ B = $ a ++;
Echo $ B;
3. Write a function to delete all subdirectories and files under the specified directory.
4. Write a function to calculate the relative paths of the two files, such:
$ A = '/a/B/c/d/e. php ';
$ B = '/a/B/12/34/c. php ';
Basic javascript knowledge
1. Talk about several methods of js implementation inheritance and write a demo.
2. Talk about the js framework you are familiar with and implement DOM Element Acquisition below
It is required to find drag = "true" and index = "1" or p without the index attribute
Tip: if you cannot write data at a time, complete the following steps.
1. Find drag = "true" and index = "1"
2. Find the drag = "true" with no index attribute
3. combine the two to get
3. Implement a mask layer effect. The elements to be displayed must be displayed in the center of the page.
4. Knowledge of closures
The Code is as follows:
Function step (){
Return function (x ){
Return x + a ++;
}
}
Var a = step (10 );
Var B = step (20 );
Alert (a (10 ));
Alert (B (20 ));
Var a = "123abc ";
Alert (typeof (a ++ ));
Alert ();
MySQL knowledge
1. In a content management system, the table message has the following fields:
Id Article id
Title article title
Content
Category_id document category id
Hits clicks
Create the table above and write MySQL statements
2. Similarly, the preceding Content Management System: The table comment records the user's reply content. The fields are as follows:
Comment_id reply id
Id Document id, associated with the id in the message table
Comment_content reply content
To query the database, you need to obtain a list of article titles in the following format and sort them by the number of replies.
Article id: number of replies in the document title
Use an SQL statement to complete the above query. If the article does not reply, the number of replies is displayed as 0.
3. In the content management system described above, the table category stores the category information. The fields are as follows:
Category_id int (4) not null auto_increment;
Categroy_name varchar (40) not null;
When you enter an article, select an article category from the drop-down menu.
Write down how to implement this drop-down menu [PHP, JAVASCRIPT, HTML]
Mysql knowledge extensions
4. The system needs to expand the classification table to support unlimited classification. Please design the table structure and complete the following scenarios based on your design:
1. Search for all articles under the specified category (including all articles under the subcategory)
2. Search for the classification of a specified article to the root classification level, for example:
The article "Mysql optimization experience" corresponds to "Program Design/Mysql/O & M /"
3. When you delete a category, you must delete all its subcategories.
5. The system needs to add the tag function to the Article (the relationship between tags and articles is many-to-many) to implement the "related articles" function. Please design this table structure,
Complete the following scenarios based on your design.
1. Search for the five articles closest to the specified article (the similarity algorithm uses the number of identical tags as the basis, and the larger the number, the more similar the description)
Comprehensive knowledge:
1. Talk about your understanding of cookies and sessions. What are their applicable scenarios? If possible, explain how to share sessions in multiple applications.
2. Talk about your understanding of single-point logon, such as the principle and implementation, and what problems need to be paid attention to during the implementation process.
3. Let's talk about your understanding of MVC. What are the shortcomings of MVC? How do you implement it if you want to implement an MVC framework?
4. How do you understand and implement permission management that you have used in your daily work?