Search
 
SCRIPT & CODE EXAMPLE
 

PHP

list all files in directory php

$path    = './';
$files = scandir($path);
$files = array_diff(scandir($path), array('.', '..'));
foreach($files as $file){
  echo "<a href='$file'>$file</a>";
}
Comment

require all files in directory php

foreach (scandir(dirname(__FILE__)) as $filename) {
    $path = dirname(__FILE__) . '/' . $filename;
    if (is_file($path)) {
        require $path;
    }
}
Comment

php get all php files in a directory

foreach(glob('includes/*.php') as $file) {
    ...
}
Comment

php list all files in directory

scandir ( string $directory [, int $sorting_order = SCANDIR_SORT_ASCENDING [, resource $context ]] ) : array
Comment

PREVIOUS NEXT
Code Example
Php :: carbon two day ago 
Php :: php echo alot of html 
Php :: try catch in laravel 
Php :: php date is before 
Php :: php find text in variable 
Php :: format date in laravel using carbon 
Php :: php version compare function 
Php :: install phpUnit in php by composer 
Php :: laravel group by on subquery 
Php :: nl2br php 
Php :: change date format php 
Php :: laravel Filesystem chmod(): Operation not permitted 
Php :: Array and string offset access syntax with curly braces is deprecated in tcpdf.php 
Php :: php dump 
Php :: laravel created_at where date format 
Php :: php array size 
Php :: php open csv 
Php :: eloquent get distinct 
Php :: laravel validate file type 
Php :: Format and show date PHP 
Php :: symfony password 
Php :: php get ip from host 
Php :: return last inserted id in laravel 
Php :: carbon months between dates 
Php :: separate date from datetime php 
Php :: PHP Simple HTML DOM 
Php :: php setinterval 
Php :: column of csv to array php 
Php :: session variable in laravel 
Php :: php split array in half 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =