sean Mon Apr 4 11:58:33 2005 EDT
Modified files: /phpdoc/en/reference/dir/functions closedir.xml Log: Added example. # from David Mytton http://cvs.php.net/diff.php/phpdoc/en/reference/dir/functions/closedir.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/dir/functions/closedir.xml diff -u phpdoc/en/reference/dir/functions/closedir.xml:1.4 phpdoc/en/reference/dir/functions/closedir.xml:1.5 --- phpdoc/en/reference/dir/functions/closedir.xml:1.4 Mon Nov 1 11:08:20 2004 +++ phpdoc/en/reference/dir/functions/closedir.xml Mon Apr 4 11:58:31 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/dir.xml, last change in rev 1.2 --> <refentry id="function.closedir"> <refnamediv> @@ -17,6 +17,26 @@ <parameter>dir_handle</parameter>. The stream must have previously been opened by <function>opendir</function>. </para> + <para> + <example> + <title><function>closedir</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?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); + } +} +?> +]]> + </programlisting> + </example> + </para> </refsect1> </refentry>