首頁  >  文章  >  後端開發  >  php程式設計師面試題一份

php程式設計師面試題一份

WBOY
WBOY原創
2016-07-25 08:59:211262瀏覽
  1. /**
  2. * 遍历目录,结果存入数组。支持php4及以上。php5以后可用scandir()函数代替while循环。
  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. }
复制代码

简述论坛中无限分类的实现原理。 设计一个网页,使得打开它时弹出一个全屏的窗口,该窗口中有一个文本框和一个按钮。用户在文本框中输入信息后点击按钮就可以把窗口关闭,而输入的信息却在主网页中显示。



陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn