Home  >  Article  >  Backend Development  >  Summary of PHP interview questions_PHP tutorial

Summary of PHP interview questions_PHP tutorial

WBOY
WBOYOriginal
2016-07-14 10:10:17853browse

1. Use PHP to print out the time of the previous day in the format of 2006-5-10 22:21:21 (2 points)

2. The difference between echo(), print() and print_r() (3 points)
 3. Templates that enable HTML and PHP to be used separately (1 point)
4. What tools are used for version control? (1 point)
5. How to implement string flipping? (3 points)
 ------------------------------------------------ ----------------
6. Methods to optimize MYSQL database. (4 points, write more and get more)
7. The meaning of PHP (get 1 point)
8. What is the function that MYSQL uses to obtain the current time?, and the function that formats dates is (2 points)
9. A method to intercept Chinese text strings without garbled characters. (3 points)
 ------------------------------------------------ ----------------
10. Have you ever used version control software? If so, what is the name of the version control software you used? (1 point)
11. Have you ever used a template engine? If so, what is the name of the template engine you used? (1 point)
12. Please briefly describe your most proud development work (4 points)
13. For websites with large traffic, what methods do you use to solve the traffic problem? (4 points)
 ------------------------------------------------ ------------------
14. Use PHP to write the code to display the client IP and server IP (1 point)
15. What is the difference between the include and require statements? To avoid including the same file multiple times, you can replace them with (?) statements? (2 points)
16. How to modify the survival time of SESSION (1 minute).
17. There is a web page address, such as the PHP Research Laboratory homepage: http://www.phpv.net/index.html, how to get its content? ($1 point)
18. In HTTP 1.0, the meaning of status code 401 is (?); if the prompt "File not found" is returned, the header function can be used, and its statement is (?); (2 points)
19. In PHP, heredoc is a special string, and its end mark must be? (1 point)
20. Talk about the advantages and disadvantages of asp, php and jsp (1 point)
21. Talk about your understanding of mvc (1 point)
 ------------------------------------------------ ------------------
22. Write the SQL of the names of the ten people with the most posts, using the following table: members (id, username, posts, pass, email) (2 points)
 23. Please explain the difference between passing by value and passing by reference in PHP. When to pass by value and when to pass by reference? (2 points)
 24. What is the function of error_reporting in PHP? (1 point)
 25. Please write a function to verify whether the format of the email is correct (2 points)
 26. Briefly describe how to get the current execution script path, including the obtained parameters. (2 points)
27. How to modify the survival time of SESSION. (1 point)
 ------------------------------------------------ --------------------------
28. What is the function to pop up a dialog box in a JS form? What is the function to get input focus? (2 points)
29. What is the redirection function of JS? How to introduce an external JS file? (2 points)
30. What is the difference between foo() and @foo()? (1 point)
31. How to declare a class named "myclass" without methods and attributes? (1 point)
32. How to instantiate an object named "myclass"? (1 point)
33. How do you access and set the attributes of a class? (2 points)
 34. What is the difference between mysql_fetch_row() and mysql_fetch_array? (1 point)
 ------------------------------------------------ --------------------------
35. What is the GD library used for? (1 point)
36. Point out some ways to enter a piece of HTML code in PHP. (1 point)
37. Which of the following functions can open a file to read and write the file? (1 point)
 (a) fget() (b) file_open() (c) fopen() (d) open_file()
38. Which of the following options does not add john to the users array? (1 point)
 (a) $users[] = ‘john’;
 (b) array_add($users,’john’);
 (c) array_push($users,‘john’);
 (d) $users ||= ‘john’;
39. Will the following program be input? (1 point)
 $num = 10;
Function multiply(){
 $num = $num * 10;
 }
multiply();
echo $num;
 ?>
40. Use PHP to write a simple query to find out all the content named "Zhang San" and print it out (2 points)
Table Name UserName Tel Content Date
Zhang San 13333663366 Graduated from college 2006-10-11
Zhang San 13612312331 Bachelor degree 2006-10-15
Zhang Si 021-55665566 Graduated from technical secondary school 2006-10-15
Please complete the code according to the above question:
$mysql_db=mysql_connect("local","root","pass");
@mysql_select_db("DB",$mysql_db);
41. How to use the following classes and explain what they mean? (3)
class test{
Function Get_test($num){
 $num=md5(md5($num)."En");
return $num;
 }
 }
 ------------------------------------------------ --------------------------
42. Write the format of SQL statements: insert, update, delete (4 points)
Table Name UserName Tel Content Date
Zhang San 13333663366 Graduated from college 2006-10-11
Zhang San 13612312331 Bachelor’s degree 2006-10-15
Zhang Si 021-55665566 Graduated from technical secondary school 2006-10-15
(a) There is a new record (Xiao Wang 13254748547 graduated from high school 2007-05-06). Please use SQL statements to add it to the table
(b) Please use sql statement to update Zhang San’s time to the current system time
(c) Please write to delete all records named Zhang Si
43. Please write the meaning of data type (int char varchar datetime text); what is the difference between varchar and char (2 points)
44. MySQ auto-increment type (usually table ID field) must be set to (?) field (1 point)
45. Write the output result of the following program (1 point)
 $b=201;
 $c=40;
 $a=$b>$c?4:5;
echo $a;
 ?>
46. Is there a function that detects whether a variable is set? What is the function that detects whether it is empty? (2 points)
 ------------------------------------------------ ----------------------------------
47. What is the function to obtain the total number of query result sets? (1 point)
48. $arr = array('james', 'tom', 'symfony'); Please print out the value of the first element (1 point)
49. Please separate the array values ​​in question 41 with ',' signs and merge them into string output (1 point)
50. $a = 'abcdef'; Please take out the value of $a and print out the first letter (1 point)
51. Can PHP be connected to databases such as sql server/oracle? (1 point)
52. Please write the PHP5 permission control modifier (3 points)
53. Please write the constructor and destructor of php5 (2 points)
 ------------------------------------------------ ----------------------------------
54. Please use PHPMYADMIN to complete the following
(1) Create a news release system. The table name is message and has the following fields (3 points)
 id article id
Title Article title
content article content
category_id article category id
Hits Clicks
(2) The same news release system as above: the comment table records the content of user replies, and the fields are as follows (4 points)
Comment_id reply id
id article id, associated with the id in the message table
comment_content reply content
Now you 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 Number of 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) The above content management system, the category table saves classification information, the fields are as follows (3 points)
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
Fill in the blanks
 1. In PHP, the name of the current script (excluding path and query string) is recorded in the predefined variable ____; and the URL linking to the current page is recorded in the predefined variable ____.
2. The execution program segment will output ____.
3. In HTTP 1.0, the meaning of status code 401 is ____; if a "File not found" prompt is returned, the header function can be used, and its statement is ____.
4. The function of array function arsort is ____; the function of statement error_reporting(2047) is ____.
 5.The database connection string format in PEAR is____.
6. Write a regular expression to filter all JS/VBS scripts on the web page (that is, remove the scrīpt tag and its content): ____.
7. Install PHP as an Apache module. In the file http.conf, first use the statement ____ to dynamically load the PHP module, and then use the statement ____ to make Apache treat all files with the extension php as PHP script processing.
8. The statements include and require can include another file into the current file. The difference between them is ____; in order to avoid including the same file multiple times, you can use the statement ____ instead.
9. The attributes of a class can be serialized and saved to the session, so that the entire class can be restored later. The function used for this is ____.
10. The parameter of a function cannot be a reference to a variable, unless ____ is set to on in php.ini.
 11.The meaning of LEFT JOIN in SQL is____. 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 the SQL statement____.
 12. In PHP, heredoc is a special string, and its end mark must be____.
Programming questions
 
 1. Write a function to retrieve the file extension from a standard URL as efficiently as possible
For example: http://www.sina.com.cn/abc/de/fg.php?id=1 You need to remove php or .php
 2. In HTML language, the meta tag in the header of the page can be used to output the encoding format of the file. The following is a standard meta statement
Please use PHP language to write a function to change the charset part value in a similar meta tag in a standard HTML page to big5
Please note:
 1. Need to process the complete html page, that is, not just this meta statement
2. Ignore case
 3. ' and " are interchangeable here
4. The quotation marks on both sides of 'Content-Type' can be ignored, but the quotation marks on both sides of 'text/html; charset=gbk' are not allowed
5. Pay attention to excess spaces
3. Write a function to calculate the relative paths of two files
For example $a = '/a/b/c/d/e.php';
$b = '/a/b/12/34/c.php';
Calculate that the relative path of $b relative to $a should be ../../c/d and add () to
3. Write a function that can traverse all files and subfolders in a folder.
4. Briefly describe the implementation principle of infinite classification in the forum.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477539.htmlTechArticle1. Use PHP to print out the time of the previous day in the format of 2006-5-10 22:21:21 (2 points ) 2. The difference between echo(), print(), and print_r() (3 points) 3. Templates that can separate HTML and PHP (1 point) 4. Which ones to use...
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