cvs: phpdoc /en/reference/filesystem/functions file-exists.xml
| From: | Philip Olson | Date: | Fri, 18 Oct 2002 01:00:34 +0000 |
| Subject: | cvs: phpdoc /en/reference/filesystem/functions file-exists.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969349160@lists.php.net to get a copy of this message | ||
philip Thu Oct 17 21:00:34 2002 EDT
Modified files:
/phpdoc/en/reference/filesystem/functions file-exists.xml
Log:
Added an example; moved the windows share information to a note;
See also is_readable(), is_writable(), is_file(), and file().
Index: phpdoc/en/reference/filesystem/functions/file-exists.xml
diff -u phpdoc/en/reference/filesystem/functions/file-exists.xml:1.3
phpdoc/en/reference/filesystem/functions/file-exists.xml:1.4
--- phpdoc/en/reference/filesystem/functions/file-exists.xml:1.3 Sun Jun 2 15:09:28 2002
+++ phpdoc/en/reference/filesystem/functions/file-exists.xml Thu Oct 17 21:00:32 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<refentry id="function.file-exists">
<refnamediv>
@@ -25,11 +25,36 @@
The results of this function are cached. See
<function>clearstatcache</function> for more details.
</simpara>
- <simpara>
- On windows use "//computername/share/filename" or
- "\\\\computername\share\filename" to check files on
- network shares.
- </simpara>
+ <note>
+ <title>Using Windows shares</title>
+ <para>
+ On windows, use <filename>//computername/share/filename</filename> or
+ <filename>\\\\computername\share\filename</filename> to check files on
+ network shares.
+ </para>
+ </note>
+ <para>
+ <example>
+ <title>Testing whether a file exists</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$filename = '/path/to/foo.txt';
+
+if (file_exists($filename)) {
+ print "The file $filename exists";
+} else {
+ print "The file $filename does not exist";
+}
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ See also <function>is_readable</function>,
<function>is_writable</function>,
+ <function>is_file</function> and <function>file</function>.
+ </para>
</refsect1>
</refentry>