A relatively basic php programmer interview question, the test is relatively basic, but there are a lot of details, if the Foundation is not strong, it is also very difficult to close. For more information, see. 1. in PHP, the name of the current script (excluding the path and query string) is recorded in the predefined variable (1), and the URL linked to the current page is recorded in the predefined variable (2). 2. Execution section Output (3 ). 3. in HTTP 1.0, status code 401 indicates (4). if the "File Not Found" prompt is returned, the header function is available. The statement is (5 ). 4. The role of the array function arsort is (6); the role of the statement error_reporting (2047) is (7 ). 5. the format of the database connection string in PEAR is (8 ). 6. write a regular expression and overwrite all JS/VBS scripts on the webpage (that is, remove the script tag and its content): (9 ). 7. install PHP using the Apache module in the http. in the conf file, first use statement (10) to dynamically load the PHP module, and then use statement (11) to make Apache process all files with the extension of php as PHP scripts. 8. the statement include and require can both include another file to the current file. The difference is (12). to avoid multiple inclusion of the same file, you can use the statement (13) to replace them. 9. attributes of the class can be serialized and saved to the session, so that the entire class can be restored later. the Function used is (14 ). 10. a function parameter cannot be a reference to a variable unless (15) is set to on. 11. the meaning of left join in SQL is (16 ). If tbl_user records the student's name and student ID, tbl_score records the student's student ID (ID) (which is not recorded after some students take the test) to print the name of each student and the total score of each subject, use the SQL statement (17 ). 12. in PHP, heredoc is a special string whose end mark must be (18 ). 13. write a function to traverse all files and subfolders in a folder. 14. briefly describe the implementation principles of unlimited classification in the forum. 15. design a webpage so that a full screen window is displayed when it is opened, which contains a text box and a button. After entering information in the text box, you can click the button to close the window, but the entered information is displayed on the main page. // Answer (blank): 1. echo $ _ SERVER ['php _ SELF ']; echo $ _ SERVER ["HTTP_REFERER"]; 2. 0 3. (4) unauthorized (5) header ("HTTP/1.0 404 Not Found"); 4. (6) reverse sort the array and maintain the index relationship (7) All errors and warnings 5. fail to understand 6./ ]. *?>. *? <\/Script>/si 7. (10) LoadModule php5_module "D:/xampp/apache/bin/php5apache2. dll "(11) AddType application/x-httpd-php-source. phps AddType application/x-httpd-php. php. php5. php4. php3. phtml 8. (12) include generates a warning when an exception occurs. require generates a fatal error (13) require_once ()/include_once () 9. serialize ()/unserialize () 10. allow_call_time_pass_reference 11. (16) natural left outer join (17) select name, count (score) as sum_score from tbl_user left join tbl_score on tbl_user.ID = tbl_score.ID group by tbl_user.ID 12. the row of the end identifier cannot contain any other characters except ";" 13. /*** traverse the directory and save the result to an array. Php4 and above are supported. Php5 and later use the scandir () function to replace the while loop. * @ Param string $ dir * @ return array */function my_scandir ($ dir) {$ files = array (); if ($ handle = opendir ($ dir )) {while ($ file = readdir ($ handle ))! = False) {if ($ file! = "..." & $ File! = ". ") {If (is_dir ($ dir. "/". $ file) {$ files [$ file] = rec_scandir ($ dir. "/". $ file) ;}else {$ files [] = $ file ;}} closedir ($ handle); return $ files ;}}I hope the above php interview questions will help you. I wish you a smooth job search. |