mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
WS fixes
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@55320 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
0841a9c4d8
commit
8dd65bea75
1 changed files with 10 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
|||
<!-- $Revision: 1.18 $ -->
|
||||
<!-- $Revision: 1.19 $ -->
|
||||
<reference id="ref.dir">
|
||||
<title>Directory functions</title>
|
||||
<titleabbrev>Directories</titleabbrev>
|
||||
|
@ -62,26 +62,26 @@
|
|||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>new <function>dir</function></funcdef>
|
||||
<funcdef>object <function>dir</function></funcdef>
|
||||
<paramdef>string <parameter>directory</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
A pseudo-object oriented mechanism for reading a directory. The
|
||||
given <parameter>directory</parameter> is opened. Two properties
|
||||
are available once directory has been opened. The handle
|
||||
are available once the directory has been opened. The handle
|
||||
property can be used with other directory functions such as
|
||||
<function>readdir</function>, <function>rewinddir</function> and
|
||||
<function>closedir</function>. The path property is set to path
|
||||
the directory that was opened. Three methods are available:
|
||||
read, rewind and close.
|
||||
<example>
|
||||
<title><function>dir</function> Example</title>
|
||||
<title><function>dir</function> example</title>
|
||||
<programlisting role="php">
|
||||
$d = dir("/etc");
|
||||
echo "Handle: ".$d->handle."<br>\n";
|
||||
echo "Path: ".$d->path."<br>\n";
|
||||
while($entry=$d->read()) {
|
||||
while ($entry = $d->read()) {
|
||||
echo $entry."<br>\n";
|
||||
}
|
||||
$d->close();
|
||||
|
@ -159,12 +159,12 @@ $d->close();
|
|||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>opendir</function> Example</title>
|
||||
<title><function>opendir</function> example</title>
|
||||
<programlisting role="php">
|
||||
<?php
|
||||
|
||||
if ($dir = @opendir("/tmp")) {
|
||||
while($file = readdir($dir)) {
|
||||
while ($file = readdir($dir)) {
|
||||
echo "$file\n";
|
||||
}
|
||||
closedir($dir);
|
||||
|
@ -201,7 +201,7 @@ if ($dir = @opendir("/tmp")) {
|
|||
$handle=opendir('.');
|
||||
echo "Directory handle: $handle\n";
|
||||
echo "Files:\n";
|
||||
while (($file = readdir($handle))!==false) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
echo "$file\n";
|
||||
}
|
||||
closedir($handle);
|
||||
|
@ -221,8 +221,8 @@ closedir($handle);
|
|||
</title>
|
||||
<programlisting role="php">
|
||||
<?php
|
||||
$handle=opendir('.');
|
||||
while (false!==($file = readdir($handle))) {
|
||||
$handle = opendir('.');
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != "." && $file != "..") {
|
||||
echo "$file\n";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue