This shows you the differences between two versions of the page.
uphp:functions:findfirst [2017/03/05 12:21] jeff |
uphp:functions:findfirst [2021/09/13 05:57] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======findfirst====== | ||
- | < | ||
- | |||
- | Start searching the current folder for files matching a pattern and attributes | ||
- | |||
- | ====Description==== | ||
- | <well size=" | ||
- | <span style=" | ||
- | < | ||
- | <span style=" | ||
- | <span style=" | ||
- | <span style=" | ||
- | <span style=" | ||
- | <span style=" | ||
- | </ | ||
- | |||
- | Begin a search to iterate through a list of files | ||
- | |||
- | ====Parameters==== | ||
- | < | ||
- | |||
- | < | ||
- | |||
- | ====Return Value==== | ||
- | Array of the first matching file containing the following keys and values: | ||
- | |||
- | ^KEY^TYPE^VALUE^ | ||
- | |filename|< | ||
- | |attributes|< | ||
- | |filesize|< | ||
- | |timestamp|< | ||
- | |||
- | ====Example==== | ||
- | <code php> | ||
- | < | ||
- | //list all files in the root directory: | ||
- | chdir("/" | ||
- | $arr=findfirst(" | ||
- | while ($arr) { | ||
- | print($arr[' | ||
- | $arr=findnext(); | ||
- | } | ||
- | ?> | ||
- | </ | ||
- | </ | ||
- | |||
- | ====See Also==== | ||
- | [[findnext()]] - Return next matching file information | ||
- | |||
- | [[chdir()]] - Change uPHP's current directory | ||
- | |||
- | [[file_exists()]] - Check if a file exists | ||
- | |||
- | [[filesize()]] - Return the size of a file, or the number of unread bytes in a stream | ||
- | |||
- | [[timefromfat]] - Convert a FAT filetime to a native Linux timestamp | ||
- | |||
- | [[uphp: | ||