PHP mod_korean extension Reference
  • Introduction
  • Installation
  • APIs
    • Check Functions
      • check_filename_lib
      • check_htmltbale_lib
      • check_uristr_lib
      • get_microtime_lib
      • human_fsize_lib
      • is_email_lib
      • is_hangul_lib
      • is_iis_lib
      • is_url_lib
      • is_windows_lib
      • buildno_lib
      • version_lib
    • Filesystem Functions
      • filelist_lib
      • getfile_lib
      • getfiletype_lib
      • putfile_lib
      • readfile_lib
      • pcregrep_lib
    • HTML Functions
      • agentinfo_lib
      • autolink_lib
      • get_hostname_lib
      • movepage_lib
      • perror_lib
      • pnotice_lib
    • Charset Functions
      • ncrencode_lib
      • ncrdecode_lib
      • uniencode_lib
      • unidecode_lib
      • utf8encode_lib
      • utf8decode_lib
      • substr_lib
      • postposition_lib
    • Image Functions
      • imgresize_lib
    • Mail Functions
      • mailsource_lib
      • sockmail_lib
Powered by GitBook
On this page
  • Proto type
  • Description
  • Arguments
  • Example
  • See also

Was this helpful?

  1. APIs
  2. Filesystem Functions

filelist_lib

Proto type

array filelist_lib (string path, [ string mode, [ string regex ] ])

Description

지정한 디렉토리에 있는 디렉토리 리스트를 배열로 구하는 함수. 파일, 디렉토리, 링크 별로 리스트를 구할 수 있으며, 조합 역시 가능하다.

win32 용에서 경로를 상대경로로 사용할 경우에는 realpath() 함수를 이용하여 절대 경로화를 해서 사용해야 한다.

Arguments

(string) path - listing을 할 디렉토리 경로
(string) mode
    f  : 지정한 디렉토리의 파일만 받음
    d  : 지정한 디렉토리의 디렉토리만 받음
    l  : 지정한 디렉토리의 링크만 받음
    fd : 지정한 디렉토리의 파일과 디렉토리만 받음
    fl : 지정한 디렉토리의 파일과 링크만 받음
    dl : 지정한 디렉토리의 디렉토리와 링크만 받음
(string) regex
    mode 값 또는 전체 리스트에서 정규표현식을 이용하여 리스트를 구함

Example

<?php
# /home/backup 하위의 디렉토리 리스트를 받을 경우
$a = filelist_lib ('/home/backup','d');
for( $i=0; $i<count ($a) ;$i++ ) {
  echo $a[$i]."\n";
}

# /home/backup 에 있는 파일 중, tar.gz 파일들만 받을 경우
$a = filelist_lib ('/home/backup','f','tar\.gz$');
for( $i=0; $i<count ($a); $i++ ) {
  echo $a[$i]."\n";
}
?>

See also

None

PreviousFilesystem FunctionsNextgetfile_lib

Last updated 5 years ago

Was this helpful?