Home >Backend Development >PHP Tutorial >A copy of php programmer interview questions

A copy of php programmer interview questions

WBOY
WBOYOriginal
2016-07-25 08:59:211308browse
  1. /**
  2. * Traverse the directory and store the results in an array. Supports php4 and above. After php5, the scandir() function can be used to replace the while loop.
  3. * @param string $dir
  4. * @return array
  5. */
  6. my_scandir($dir)
  7. {
  8. $files = array();
  9. if ( $handle = opendir($dir) )
  10. {
  11. while ( ($file = readdir($handle)) !== false )
  12. {
  13. if ( $file != ".." && $file != "." )
  14. {
  15. if ( is_dir($dir . "/" . $file) )
  16. {
  17. $files[$file] = rec_scandir($dir . "/" . $file);
  18. }
  19. else
  20. {
  21. $files[] = $file;
  22. }
  23. }
  24. }
  25. closedir($handle );
  26. return $files;
  27. }
  28. }
Copy code

Briefly describe the implementation principle of unlimited classification in the forum. Design a web page so that when it is opened, a full-screen window pops up with a text box and a button. After the user enters information in the text box and clicks the button, the window can be closed, while the entered information is displayed on the main web page.



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