Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php get all txt files in directory

$path = '/path/to/directory';
$files = glob($path."/*.txt");
foreach ($files as $file) {
  echo $file;
  echo '<br>';
}
/* Outputs something like: 
	/path/to/directory/someFile.txt
	/path/to/directory/someOtherFile.txt
	/path/to/directory/anotherFile.txt
*/
Comment

PREVIOUS NEXT
Code Example
Php :: localhost install new plugin ftp wp 
Php :: php datetime object get unix timestamp 
Php :: wp_get_attachment_image class 
Php :: wordpress logout to home page 
Php :: laravel env production 
Php :: laravel check if eloquent just created 
Php :: php clear output 
Php :: php artisan migrate reset 
Php :: how to add hour minute seconds in php datetime 
Php :: click confirm before submit form php 
Php :: php discord webhook 
Php :: how to start a session 
Php :: php preg_match special characters 
Php :: how to split url in php 
Php :: laravel app get locale 
Php :: php put file in ftp server 
Php :: get site url with protocol in php 
Php :: witherrors laravel 
Php :: php time format 
Php :: dynamic alert php 
Php :: php check if string email 
Php :: group users on country vice in laravel 
Php :: laravel json 
Php :: Print exact sql statement executed 
Php :: the requested url was not found on this server. laravel 
Php :: laravel get host with http 
Php :: isset submit in php 
Php :: how to claer the input php 
Php :: php how to convert string to int 
Php :: php counting number of chars excluding newlines 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =