php-documentation-list | 2003101

[PHP-DOC] cvs: phpdoc /en/reference/dir/functions chdir.xml From: Vincent Gevers (vincent <email protected>)
Date: 10/13/03

vincent Mon Oct 13 05:52:52 2003 EDT

  Modified files:
    /phpdoc/en/reference/dir/functions chdir.xml
  Log:
  Adding example
  
  
Index: phpdoc/en/reference/dir/functions/chdir.xml
diff -u phpdoc/en/reference/dir/functions/chdir.xml:1.4 phpdoc/en/reference/dir/functions/chdir.xml:1.5
--- phpdoc/en/reference/dir/functions/chdir.xml:1.4 Sun Jan 26 20:00:18 2003
+++ phpdoc/en/reference/dir/functions/chdir.xml Mon Oct 13 05:52:52 2003
@@ -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.chdir">
    <refnamediv>
@@ -15,6 +15,35 @@
     <para>
      Changes PHP's current directory to
      <parameter>directory</parameter>. &return.success;.
+ </para>
+ <para>
+ <example>
+ <title><function>chdir</function></title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+// current directory
+echo getcwd() . "\n";
+
+chdir ('public_html');
+
+// current direcorty
+echo getcwd() . "\n";
+
+?>
+]]>
+ </programlisting>
+ <para>
+ This example will output
+ </para>
+ <screen>
+<![CDATA[
+/home/vincent
+/home/vincent/public_html
+]]>
+ </screen>
+ </example>
     </para>
     <para>
      See also <function>getcwd</function>.