This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
uphp:functions:findfirst [2017/03/05 12:21] jeff |
uphp:functions:findfirst [2021/09/13 05:57] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
======findfirst====== | ======findfirst====== | ||
+ | |||
< | < | ||
Line 5: | Line 6: | ||
====Description==== | ====Description==== | ||
- | <well size=" | + | |
- | <span style=" | + | <well size=" |
- | < | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
+ | <span style=" | ||
</ | </ | ||
Line 18: | Line 20: | ||
====Parameters==== | ====Parameters==== | ||
- | < | ||
- | < | + | <html><b>< |
- | ====Return | + | < |
- | Array of the first matching file containing the following keys and values: | + | |
+ | ====Return | ||
+ | |||
+ | < | ||
^KEY^TYPE^VALUE^ | ^KEY^TYPE^VALUE^ | ||
- | |filename|< | + | |filename|< |
- | |attributes|< | + | |attributes|< |
- | |filesize|< | + | |filesize|< |
- | |timestamp|< | + | |timestamp|< |
====Example==== | ====Example==== | ||
+ | |||
+ | ===List all files in the root directory=== | ||
+ | |||
<code php> | <code php> | ||
< | < | ||
- | //list all files in the root directory: | + | |
- | chdir("/" | + | $arr=findfirst(" |
- | $arr=findfirst(" | + | while ($arr) { |
- | while ($arr) { | + | print($arr[' |
- | print($arr[' | + | $arr=findnext(); |
- | $arr=findnext(); | + | } |
- | } | + | ?></ |
- | ?> | + | |
- | </ | + | |
</ | </ | ||
- | ====See Also==== | + | ====Also |
- | [[findnext()]] - Return next matching file information | + | |
- | [[chdir()]] - Change uPHP's current directory | + | [[findnext()]] - Return next matching file information (after a findfirst) |
- | [[file_exists()]] - Check if a file exists | + | [[timefromfat()]] - Convert |
- | [[filesize()]] - Return the size of a file, or the number of unread bytes in a stream | + | [[strftime()]] - Format |
- | [[timefromfat]] - Convert a FAT filetime to a native Linux timestamp | + | [[chdir()]] - Change the current directory |
+ | |||
+ | [[file_exists()]] - Check if a file exists | ||
- | [[uphp: | + | [[filesize()]] - Return the size of a file, or the number of unread bytes in a stream or socket |