폴더내의 파일명 출력하는 건데, 코드가 실행이 안되고 멈춰 있습니다.

폴더내의 파일명 출력하는 건데, 코드가 실행이 안되고 멈춰 있습니다.

QA

폴더내의 파일명 출력하는 건데, 코드가 실행이 안되고 멈춰 있습니다.

답변 1

본문

 
  <?php
    $path = G5_DATA_PATH.'/file/'.$bo_table.'/'.$wr_id.'/'; // 끝에 꼭 경로 구분자
    
    $dh = opendir($path);
    $dirs = $files = array();
    while ( ($read=readdir($dh))!==false )
    {
     if ( $read=='.' || $read=='..' ) continue;
     if ( is_dir($path.$read) ) { $dirs[] = $read; } else { $files[] = $read; }
    }
    
     for ($c=0; $c < count($files); $c++) {
      echo "<img src=".$path."".$files[$c]." width=200 />";
      echo "   ";
     }
   ?>       
 

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 59,815
© SIRSOFT
현재 페이지 제일 처음으로