User Tools

Site Tools


uphp:functions:findnext

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
uphp:functions:findnext [2017/03/05 14:24]
jeff created
uphp:functions:findnext [2021/09/13 05:57] (current)
Line 1: Line 1:
 ======findnext====== ======findnext======
 +
 <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge>
  
Line 5: Line 6:
  
 ====Description==== ====Description====
-<well size="sm"><html><span style="font-size:125%;color:green;">array + 
-<span style="color:black;"></html>[[findnext]] ( ) +<well size="sm"><html> 
-</well>+<span style="font-size:125%;color:green">array 
 +<span style="color:black">findnext ( ) 
 +</html></well>
  
 Continue a search to iterate through a list of files Continue a search to iterate through a list of files
  
 ====Parameters==== ====Parameters====
 +
 None None
  
-====Return Value==== +====Return Values==== 
-Array of the next matching file containing the following keys and values:+ 
 +<html><b><span style="color:green">Array<span style="color:black"></b></html> of the next matching file containing the following keys and values:
  
 ^KEY^TYPE^VALUE^ ^KEY^TYPE^VALUE^
-|filename|<html><span style="color:green;">string</html>|Name of the file| +|filename|<html><b><span style="color:green">string</b></html>|Name of the file| 
-|attributes|<html><span style="color:green;">int</html>|[[os:fat_file_system#attributes|FAT file attributes]]| +|attributes|<html><b><span style="color:green">int</b></html>|[[software:os:fat_file_system#attributes|FAT file attributes]]| 
-|filesize|<html><span style="color:green;">int</html>|File size in bytes| +|filesize|<html><b><span style="color:green">int</b></html>|File size in bytes| 
-|timestamp|<html><span style="color:green;">int</html>|[[os:fat_file_system#timestamps|FAT timestamp of last save]]|+|timestamp|<html><b><span style="color:green">int</b></html>|[[software:os:fat_file_system#timestamps|FAT timestamp of last save]]|
  
 ====Example==== ====Example====
 +
 +===List details for all files and directories in the /logs directory===
 +
 <code php> <code php>
 <pre><? <pre><?
-//list details for all files and directories in the /logs directory: +  chdir("/logs"); // change to the logs folder 
-chdir("/logs"); //change to the logs folder +  $arr=findfirst("*.*",255); // get the first entry matching any file or directory 
-$arr=findfirst("*.*",255); //get the first entry matching any file or directory +  while ($arr) { 
-while ($arr) { +    print_r($arr); 
-  print_r($arr); +    print("\r\n"); 
-  print("\r\n"); +    $arr=findnext(); // get another matching file/directory 
-  $arr=findnext(); //get another matching file/directory +  }
-}+
 ?></pre> ?></pre>
 </code> </code>
  
 Typical output for the above example (results vary depending on the contents of the /logs directory): Typical output for the above example (results vary depending on the contents of the /logs directory):
 +
 <code> <code>
 [$arr] = Array ( [$arr] = Array (
Line 83: Line 91:
 </code> </code>
  
-====See Also====+====Also See==== 
 [[findfirst()]] - Start searching the current folder for files matching a pattern and attributes [[findfirst()]] - Start searching the current folder for files matching a pattern and attributes
  
-[[timefromfat()]] - Convert a FAT filetime to a native Linux timestamp+[[timefromfat()]] - Convert a FAT filetime to a Linux Timestamp
  
-[[strftime()]] - Format the passed time using the format string+[[strftime()]] - Format a Linux Timestamp using format <html><b><span style="color:green">string</b></html>
  
-[[chdir()]] - Change uPHP'current directory+[[chdir()]] - Change the current directory
  
 [[file_exists()]] - Check if a file exists [[file_exists()]] - Check if a file exists
  
-[[filesize()]] - Return the size of a file, or the number of unread bytes in a stream +[[filesize()]] - Return the size of a file, or the number of unread bytes in a stream or socket
- +
-[[uphp:control_structures:while]] - Flow control structure for a conditional loop+
  
-[[print_r()]] - Dump the contents of an array to the current output+[[print_r()]] - Dump the contents of an <html><b><span style="color:green">array<span style="color:black"></b></html> to the current output
  
uphp/functions/findnext.1488723881.txt.gz · Last modified: 2021/09/13 05:56 (external edit)