php面试题

1、php中error_reporting这个函数是干什么?
   答:设置错误级别与错误信息回报。
2、写一个函数:一个文件夹下显示所有文件和子文件夹
   答:  function showFile($filename){
                  $files=array();
                  if($handle=opendir($filename)){
                        while(($file=readdir($handle))!==false){
                               if($file!=".."&&file!="."){
                                       if(is_dir($filename."/".$file)){
                                          $files[$file]=scandir($filename."/".$file);
                                       }else{
                                          $files[]=$file;
                                      }
                                }
                        }
                        closedir($handle);
                  }
                  return $files;
            }


你可能感兴趣的:(php面试题)