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 :: install php8 on linux 
Php :: php remove last character in string 
Php :: how to check laravel version 
Php :: wordpress base theme child url 
Php :: var_dump smarty 
Php :: curl php show error 
Php :: laravel project htaccess redirect to public path 
Php :: laravel migration add column to existing table 
Php :: brew remove php 
Php :: composer laravel ui 
Php :: php get current domain 
Php :: remove html tags from string php 
Php :: update php version using htaccess 
Php :: php remove file 
Php :: php preg_match email validation code 
Php :: storage image not showing in laravel 
Php :: redirect http to https htaccess 
Php :: zsh: command not found: laravel 
Php :: composer install –ignore-platform-reqs 
Php :: drupal 8 get all nodes of type 
Php :: wordpress print all categories 
Php :: php make query string from array 
Php :: how to get category from post id 
Php :: laravel redirect external url 
Php :: laravel scout import command 
Php :: php 3 months ago 
Php :: install php-8 extentions 
Php :: trim comma from variable in php 
Php :: laravel response redirect 
Php :: php json key value loop 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =