downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<dirgetcwd>
Last updated: Thu, 26 Jun 2008

closedir

(PHP 4, PHP 5)

closedir — Close directory handle

Description

void closedir ( resource $dir_handle )

Closes the directory stream indicated by dir_handle . The stream must have previously been opened by opendir().

Parameters

dir_handle

The directory handle resource previously opened with opendir().

Examples

Example #1 closedir() example

<?php
$dir
= "/etc/php5/";

// Open a known directory, read directory into variable and then close
if (is_dir($dir)) {
   if (
$dh = opendir($dir)) {
      
$directory = readdir($dh);
      
closedir($dh);
   }
}
?>



add a noteadd a note User Contributed Notes
Close directory handle
There are no user contributed notes for this page.




<dirgetcwd>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs