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 :: preg_split in php 
Php :: install phpmyadmin ubuntu 18.04 
Php :: remove square brackets from string php 
Php :: php library to convert html to amp 
Php :: laravel middleware 
Php :: laravel filter get pagiination does not flter Appending To Pagination Links 
Php :: Diferencia entre dias PHP - Con date_diff() 
Php :: drop foreign key laravel 
Php :: php get multiple url parameters 
Php :: laravel relationship delete all 
Php :: woocommerce disable links on specific product 
Php :: php epoch conversion 
Php :: how to know if file is empty in php 
Php :: laravel adding condition to relation 
Php :: Codeigniter 3 Pass anything in query string 
Php :: php get duplicate keys in array without using inbuilt function 
Php :: laravel edit form modal example 
Php :: Laravel return empty relationship on model when condition is true 
Php :: unique validation laravel 
Php :: laravel eloquent relationship 
Php :: check php-fpm version ubuntu 
Php :: Laravel PackageManifest.php: Undefined index: name 
Php :: catch warning php 
Php :: Regex to remove span tags using php [duplicate] 
Php :: php order array 
Php :: php get function from different file 
Php :: laravel FacadesDB update 
Php :: accept method in jquery 
Php :: yii2 activeform adding field css class 
Php :: stampare array php foreach 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =