How to use Directory readdir in PHP

In this article I am going to explain about readdir function in PHP.
  • 1712

PHP readdir() function

The directory readdir function is used to read and return entry from directory handle.

Syntax of  readdir function


Parameters in readdir function

It has only one parameter:

Parameter Description
dirstream It specifies the directory handle to use.

Example of directory readdir  function




$dir = opendir("C:\wamp\www\Dinesh");


while (($file = readdir($dir)) !== false)


  echo "filename: " . $file . "<br />";







readdir function.jpg

You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here


More Articles

© 2020 DotNetHeaven. All rights reserved.