What is closedir in PHP Directory

In this article I am going to explain about closedir function in PHP.
  • 1626

PHP closedir() function

The directory closedir function is used to close the open directory, who is previously opened by opendir function.

Syntax of  closedir function


Parameters in closedir function

It has only one parameter:

Parameter Description
dirHandle It specifies the directory handle to close.

Example of directory closedir  function


$dir = opendir("C:\wamp\www\Dinesh");
while (($file = readdir($dir)) !== false)
echo "filename: " . $file . "<br />";




closedir 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.