Answers for "php file names"

PHP
4

php get all php files in a directory

foreach(glob('includes/*.php') as $file) {
    ...
}
Posted by: Guest on March-21-2020
2

filename php

echo "1) ".basename("/etc/sudoers.d", ".d").PHP_EOL;//sudoers
echo "2) ".basename("/etc/sudoers.d").PHP_EOL;//sudoers.d
echo "3) ".basename("/etc/passwd").PHP_EOL;//passwd
echo "4) ".basename("/etc/").PHP_EOL;//etc
echo "5) ".basename(".").PHP_EOL;//.
echo "6) ".basename("/");//
Posted by: Guest on September-11-2020
-1

php list directories

$dir = '.';
$directories = glob($dir . '/*', GLOB_ONLYDIR);
Posted by: Guest on July-22-2020

Browse Popular Code Answers by Language