Php programmer interview questions
- /**
- * 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
- */
- 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;
- }
- }
Briefly describe the implementation principles of unlimited classification in the forum. 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. |