About 557,000 results
Open links in new tab
  1. Listing all the folders subfolders and files in a directory using php

    Use the respective functions such as filesize($ff), filemtime($ff), filetype($ff), etc... to achieve what you are looking for. A very simple way to show folder structure makes use of …

  2. 4 Ways To List Files & Folders In PHP (Simple Examples) - Code …

    Nov 12, 2023 · This tutorial will walk through examples of how to list files and folders in PHP. Free code download included.

  3. How to get names of all the subfolders and files present in a directory ...

    Apr 19, 2023 · Given the path of the folder and the task is to print the names of subfolders and files present inside them. Explanation: In our PHP code, initially, it is checked whether …

  4. How to List Files in a Directory in PHP - Envato Tuts+

    Aug 31, 2021 · In this section, we’ll discuss the opendir, readdir, and closedir functions to see how you can use them to get a list of files in a specific directory. The opendir function allows you to …

  5. PHP Listing Files in a Directory – A Complete Guide

    Feb 12, 2025 · Listing files in a directory is a common task in PHP, useful for file management, creating galleries, listing logs, or scanning directories for processing. PHP provides several …

  6. How to list files and folder in a dir (PHP) - W3docs

    In PHP, you can use the scandir() function to list the files and directories in a directory. This function returns an array of file and directory names. Here's an example: // Get an array of the …

  7. How to Get All Files and Folders in a Folder with PHP

    Aug 9, 2014 · In this tutorial, I will show you how to get all the files, subfolders and files in subfolders within a folder recursively using PHP, with the help of a detailed example.

  8. how to display folders and sub folders from dir in PHP

    Mar 28, 2013 · here is a quick example on how to use this: $dir = '/path/to/directory'; $result = array(); if (is_dir($dir)) { $iterator = new RecursiveDirectoryIterator($dir); foreach (new …

  9. PHP: How to list all files in a directory - Sling Academy

    Jan 11, 2024 · Listing all files in a directory using PHP is straightforward once you are familiar with the filesystem functions provided by the language. Whether you choose basic functions like …

  10. How to List Folders, Subfolders, and Files in a PHP Directory

    Nov 12, 2024 · Within a given directory, it's often necessary to retrieve a comprehensive list of not only files but also the nested folders and subfolders. PHP provides a versatile solution for this …

Refresh