Heim  >  Artikel  >  Backend-Entwicklung  >  php程序员面试题一份

php程序员面试题一份

WBOY
WBOYOriginal
2016-07-25 08:59:211267Durchsuche
  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. }
复制代码

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



Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn