pandach         Mon Jan 29 18:25:42 2001 EDT

  Modified files:              
    /phpdoc/kr/language references.xml variables.xml 
  Log:
  
  PR:
  Submitted by:
  Reviewed by:
  Obtained from:
  
  
Index: phpdoc/kr/language/references.xml
diff -u phpdoc/kr/language/references.xml:1.3 phpdoc/kr/language/references.xml:1.4
--- phpdoc/kr/language/references.xml:1.3       Fri Jan 12 06:16:40 2001
+++ phpdoc/kr/language/references.xml   Mon Jan 29 18:25:41 2001
@@ -1,293 +1,118 @@
- <chapter id="language.references">
-  <title>References Explained</title>
-
-  <sect1 id="language.references.whatare">
-   <title>What References Are</title>
-   <simpara>  
-    References are a means in PHP to access the same variable content 
-    by different names. They are not like C pointers, they are symbol
-    table aliases. Note that in PHP, variable name and variable content 
-    are different, so the same content can have different names.
-    The most close analogy is with Unix filenames and files -
-    variable names are directory entries, while variable contents is
-    the file itself. References can be thought of as hardlinking in
-    Unix filesystem.
-   </simpara>
-  </sect1>
-
-  <sect1 id="language.references.whatdo">
-   <title>What References Do</title>
-   <para>
-    PHP references allow you to make two variables to refer to the
-    same content. Meaning, when you do:
-    <informalexample>
-     <programlisting role="php">
-$a =&amp; $b 
-     </programlisting>
-    </informalexample>
-    it means that <varname>$a</varname> and <varname>$b</varname>
-    point to the same variable.
-    <note>
-     <para>
-      <varname>$a</varname> and <varname>$b</varname> are completely
-      equal here, that's not <varname>$a</varname> is pointing to
-      <varname>$b</varname> or vice versa, that's
-      <varname>$a</varname> and <varname>$b</varname> pointing to the
-      same place.
-     </para>
-    </note>
-   </para>
-   <para>
-   The same syntax can be used with functions, that return references,
-   and with <literal>new</literal> operator (in PHP 4.0.4 and later):
-    <informalexample>
-     <programlisting role="php">
-$bar =&amp; new fooclass();
-$foo =&amp; find_var ($bar);
-    </programlisting>
-    </informalexample>
-    </para>
-    <note>
-     <para>
-     Unless you use the syntax above, the result of 
-     <literal>$bar = new fooclass()</literal> will not be the same
-      variable as <literal>$this</literal> in the constructor, meaning
-     that if you have used reference to <literal>$this</literal> in
-     the constructor, you should use reference assignment, or you get
-     two different objects.
-     </para>
-   </note>
-   <para>
-    The second thing references do is to pass variables
-    by-reference. This is done by making a local variable in a function and
-    a variable in the calling scope reference to the same content. Example:
-    <informalexample>
-     <programlisting role="php">
-function foo (&amp;$var) {
-    $var++;
-}
-
-$a=5;
-foo ($a);
-     </programlisting>
-    </informalexample>
-    will make <varname>$a</varname> to be 6. This happens because in
-    the function <varname>foo</varname> the variable
-    <varname>$var</varname> refers to the same content as
-    <varname>$a</varname>. See also more detailed explanations about <link
-    linkend="language.references.pass">passing by reference</link>.
-   </para>
-   <simpara>
-    The third thing reference can do is <link
-    linkend="language.references.return">return by reference</link>.
-   </simpara>
-  </sect1>
-
-  <sect1 id="language.references.arent">
-   <title>What References Are Not</title>
-   <para>
-    As said before, references aren't pointers. That means, the
-    following construct won't do what you expect:
-    <informalexample>
-     <programlisting role="php">
-function foo (&amp;$var) {
-    $var =&amp; $GLOBALS["baz"];
-}
-foo($bar); 
-     </programlisting>
-    </informalexample>
-   </para>
-   <simpara>
-    What happens is that <varname>$var</varname> in foo will be bound
-    with <varname>$bar</varname> in caller, but then it will be
-    re-bound with <varname>$GLOBALS["baz"]</varname>. There's no way
-    to bind <varname>$bar</varname> in the calling scope to something else
-    using the reference mechanism, since <varname>$bar</varname> is not
-    available in the function foo (it is represented by
-    <varname>$var</varname>, but <varname>$var</varname> has only
-    variable contents and not name-to-value binding in the calling
-    symbol table).
-   </simpara>
-  </sect1>
-
-  <sect1 id="language.references.pass">
-   <title>Passing by Reference</title>
-   <para>
-   You can pass variable to function by reference, so that function could modify
-   its arguments. The sytax is as follows:
-    <informalexample>
-     <programlisting role="php">
-function foo (&amp;$var) {
-    $var++;
-}
-
-$a=5;
-foo ($a);
-// $a is 6 here
-     </programlisting>
-    </informalexample>
-  Note that there's no reference sign on function call - only on
-  function definition. Function definition alone is enough to
-  correctly pass the argument by reference. 
-  </para>
-  <para>
-  Following things can be passed by reference:
-   <itemizedlist>
-    <listitem>
-     <simpara>
-      Variable, i.e. <literal>foo($a)</literal>
-     </simpara>
-    </listitem>
-    <listitem>
-     <simpara>
-      New statement, i.e. <literal>foo(new foobar())</literal>
-     </simpara>
-    </listitem>
-    <listitem>
-     <para>
-      Reference, returned from a function, i.e.:
-    <informalexample>
-     <programlisting role="php">
-function &amp;bar()
-{
-   $a = 5;
-   return $a;
-}
-foo(bar());
-     </programlisting>
-    </informalexample>
-    See also explanations about <link
-    linkend="language.references.return">returning by reference</link>. 
-     </para>
-    </listitem>
-  </itemizedlist>
-  </para>
-  <para>
-  Any other expression should not be passed by reference, as the
-  result is undefined. For example, the following examples of passing
-  by reference are invalid:
-    <informalexample>
-     <programlisting role="php">
-function bar() // Note the missing &amp;
-{
-        $a = 5;
-        return $a;
-}
-foo(bar));
-
-foo($a = 5) // Expression, not variable
-foo(5) // Constant, not variable
-     </programlisting>
-    </informalexample>
-These requirements are for PHP 4.0.4 and later.
-  </para>
-  </sect1>
-
-  <sect1 id="language.references.return">
-   <title>Returning References</title>
-   <para>
-    Returning by-reference is useful when you want to use a function
-    to find which variable a reference should be bound to. When
-    returning references, use this syntax:
-    <informalexample>
-     <programlisting role="php">
-function &amp;find_var ($param) {
-    ...code...
-    return $found_var;
-}
-
-$foo =&amp; find_var ($bar);
-$foo->x = 2; 
-     </programlisting>
-    </informalexample>
-    In this example, the property of the object returned by the
-    <varname>find_var</varname> function would be set, not the
-    copy, as it would be without using reference syntax.
-   </para>
-   <note>
-    <simpara>
-     Unlike parameter passing, here you have to use
-     <literal>&amp;</literal> in both places - to indicate that you
-     return by-reference, not a copy as usual, and to indicate that
-     reference binding, rather than usual assignment, should be done
-     for <varname>$foo</varname>.
-    </simpara>
-   </note>
-  </sect1>
-
-  <sect1 id="language.references.unset">
-   <title>Unsetting References</title>
-   <para>
-    When you unset the reference, you just break the binding between
-    variable name and variable content. This does not mean that
-    variable content will be destroyed. For example:
-    <informalexample>
-     <programlisting role="php">
-$a = 1;
-$b =&amp; $a;
-unset ($a); 
-     </programlisting>
-    </informalexample>
-    won't unset <varname>$b</varname>, just <varname>$a</varname>. 
-   </para>
-   <simpara>
-    Again, it might be useful to think about this as analogous to Unix
-    <command>unlink</command> call.
-   </simpara>
-  </sect1>
-
-  <sect1 id="language.references.spot">
-   <title>Spotting References</title>
-   <simpara>
-    Many syntax constructs in PHP are implemented via referencing
-    mechanisms, so everything told above about reference binding also
-    apply to these constructs. Some constructs, like passing and
-    returning by-reference, are mentioned above. Other constructs that
-    use references are:
-   </simpara>
-
-   <sect2 id="references.global">
-    <title><literal>global</literal> References</title>
-    <para>
-     When you declare variable as <command>global $var</command> you
-     are in fact creating reference to a global variable. That means,
-     this is the same as:
-     <informalexample>
-      <programlisting role="php">
-$var =&amp; $GLOBALS["var"];
-      </programlisting>
-     </informalexample>
-    </para>
-    <simpara>
-     That means, for example, that unsetting <varname>$var</varname>
-     won't unset global variable.
-    </simpara>
-   </sect2>
-
-   <sect2 id="references.this">
-    <title><literal>$this</literal></title>
-    <simpara>
-     In an object method, <varname>$this</varname> is always reference
-     to the caller object.
-    </simpara>
-   </sect2>
-  </sect1>
-
- </chapter>
- 
-<!-- Keep this comment at the end of the file
-Local variables:
-mode: sgml
-sgml-omittag:t
-sgml-shorttag:t
-sgml-minimize-attributes:nil
-sgml-always-quote-attributes:t
-sgml-indent-step:1
-sgml-indent-data:t
-sgml-parent-document:nil
-sgml-default-dtd-file:"../../manual.ced"
-sgml-exposed-tags:nil
-sgml-local-catalogs:nil
-sgml-local-ecat-files:nil
-End:
--->
+<!-- edited with XML Spy v3.0.7 NT (http://www.xmlspy.com) by panda (bra) --><chapter 
+id="language.references">        <title>References Explained</title>     <sect1 
+id="language.references.whatare">                <title>참조(Reference)란 
+무엇인가.</title>               <simpara>  
+    참조란 PHP에서 동일한 값을 서로다른 이름으로 access 하는 
+것을 말한다.
+    참조는 C언어 에서의 pointer와는 구별되며, simbol table과 같다고 
+할수 있다. PHP
+    에서는 변수명과 변수값이 다르다는것을 주의 해야 한다. 
+따라서, 동일한 
+    내용이 다른 이름을 가질수 있다. 이는 변수값이 파일이지만 
+변수명은 
+    디렉토리의 요소인 UNIX에서 file과 filename과의 관계와 
+매우유사하다.
+    참조는 UNIX 파일 시스템에서의 hardlinking으로 생각할수 있다.
+   </simpara>  </sect1>        <sect1 id="language.references.whatdo">         
+<title>참조로 할수 있는일은(What References Do)</title>                <para>
+    첫번째로 PHP에서의 참조는 두개의 다른 변수가 동일한 
+내용(content)를 
+    가리킬수 있게 한다. 다시말해 다음과 같은 문장이 있다면
+    <informalexample>                          <programlisting role="php">
+$a =&amp; $b 
+     </programlisting>                 </informalexample>
+    이는
+<varname>$a</varname> 와<varname>$b</varname>
+    는 동일한 변수라고 할수 있다    <note>                         <para> 
+                                 <varname>$a</varname> 와<varname>$b</varname> 는 
+이 문장에서는 완벽하게 동일한 변수이지만,<varname>$a</varname> 가  
+     <varname>$b</varname> 를 가리킨다. 이는 다시말해      
+<varname>$a</varname> 와<varname>$b</varname> 는 동일한 위치의 
+내용(content)를 지칭하고 있다.
+     </para>                   </note>         </para>         <para>
+   함수에서도 변수에서 적용되는 것과 동일하게 적용된다. 
+<literal>new</literal> 라는 연산자를 사용하여 참조를 돌려줄수 
+있다.(이는 PHP 4.0.4이후 버젼에 적용된다.)    <informalexample>          
+                   <programlisting role="php">
+$bar =&amp; new fooclass();
+$foo =&amp; find_var ($bar);
+    </programlisting>                  </informalexample>              </para>        
+ <note>                  <para>
+     Unless you use the syntax above, the result of 
+     <literal>$bar = new fooclass()</literal> will not be the same
+      variable as <literal>$this</literal> in the constructor, meaning
+     that if you have used reference to <literal>$this</literal> in
+     the constructor, you should use reference assignment, or you get
+     two different objects.
+     </para>           </note>         <para>    참조로 할수 있는 두번째 
+것은 참조에 의한 변수의 전달이다. 이는 함수 내에서    생성된 
+지역변수와 함수를 호출한 영역의 변수가 동일한 값을 가리키게 
+할 수 있다.
+    아래의 예를 보자<informalexample>                           
+<programlisting role="php">
+function foo (&amp;$var) {
+    $var++;
+}
+
+$a=5;
+foo ($a);
+     </programlisting>                 </informalexample><varname>$a</varname> 의 
+값은 6이 된다. 이는 함수<varname>foo</varname> 내의 지역변수    
+<varname>$var</varname> 가 함수를 호출한 영역의 변수    
+<varname>$a</varname>와 동일한 값(content)을 참조하기 때문이다. 이에 
+대한 좀 더 자세한 설명은<link linkend="language.references.pass">참조에 
+의한 전달(passing by reference)</link>을 확인해 보기 바란다.
+   </para>             <simpara>    세번째로 참조로서 할수 있는 
+것은<link linkend="language.references.return">참조에 의한 return(return by 
+reference)</link>이다.
+   </simpara>  </sect1>        <sect1 id="language.references.arent">          
+<title>참조를 사용함에 있어 주의 해야 할것(What References Are 
+Not)</title>              <para>   앞서 말했듯이 참조는 C 언어에서의 
+pointer와는 다르다. 아래의 예를 보고   그 결과가 우리가 
+기대했던 것과 다르다는 것을 안다면 참조(reference)와    pointer가 
+다르다는 것을 알수 있을 것이다.
+    <informalexample>                          <programlisting role="php">
+function foo (&amp;$var) {
+    $var =&amp; $GLOBALS["baz"];
+}
+foo($bar); 
+     </programlisting>                 </informalexample>              </para>        
+ <simpara>    위의 예에서 foo함수 내의 변수<varname>$var</varname> 는 
+함수를 호출한 영역의 변수<varname>$bar</varname> 와 동일한 값을 
+참조하지만  곧이어 전역변수<varname>$GLOBALS["baz"]</varname>가 
+참조하는 값을 참조하도록 바뀐다. 이제 이 함수내에서 참조의 
+메카니즘을 사용하여 함수를 호출한 영역의 
+변수<varname>$bar</varname> 를 참조할수 있는 방법이 없다. 따라서  
+함수를 호출한 영역의 변수<varname>$bar</varname> 는 함수 
+foo내에서는 무의 미할수 밖에 없다. (즉 함수를 호출한 영역의 
+변수는 함수내의 변수<varname>$var</varname>에 의해 나타낼수 
+있지만,<varname>$var</varname> 는 단지 변수값이지 symbol table에 
+정의된 변수명이 아니다.)   </simpara>     </sect1>        <sect1 
+id="language.references.pass">           <title>참조를 사용한 전달(Passing by 
+Reference)</title>         <para>  참조(reference)를 사용하여 변수를 
+함수로 넘겨 전달(pass)할수 있다. 그래서  함수 내에서 변수의 
+값을 수정할 수 있다. 다음이 그 예이다.<informalexample>                
+            <programlisting role="php">
+function foo (&amp;$var) {
+    $var++;
+}
+
+$a=5;
+foo ($a);
+// $a is 6 here
+     </programlisting>                 </informalexample>  함수를 호출할때 
+참조를 이용하여 변수를 전달(pass)한다는 어떠한 표시도 없다는 
+것에 주의하자.  단지 함수를 정의 할때 변수를 참조에 의해 
+전달 받는다는 표시가 있다. 함수를 정의할때 이를   정의 
+함으로써 참조에 의한 변수 전달이 가능하다.  </para>              
+<para>  참조에 의해 변수를 넘겨 주는 방법은 다음의 세가지 
+방법이 있다:   <itemizedlist>                               <listitem>           
+                           <simpara>      변수에 의한 방법, 
+즉.<literal>foo($a)</literal>                                  </simpara>            
+                  </listitem>                             <listitem>                  
+                    <simpara>      New라는 문장을 이용하는 방법, 
+즉.<literal>foo(new foobar())</literal>                                        
+</simpara>                              </listitem>                             
+<listitem>                                      <para>      함수로 부터 넘겨 
+받는 참조에 의한 방법, 즉.    <informalexample>                             
+                      <programlisting role="php">
+function &amp;bar()
+{
+   $a = 5;
+   return $a;
+}
+foo(bar());
+     </programlisting>                                         
+</informalexample><link linkend="language.references.return">참조에 의한 
+리턴(returning by reference)</link>의 자세한 설명을 볼수 있다. 
+     </para>                           </listitem>                     
+</itemizedlist>         </para>         <para>  위의 나열한 세가지 
+방법외에는 참조에 의한 전달(pass)을 할수 없다.  예를 들면 아래 
+예와 같은 방법으로 참조에 의한 전달은 그 의미가 그 의미가 
+정확하지 못하다.<informalexample>                             <programlisting 
+role="php">
+function bar() //  &amp; 가 빠져있음에 유의하자;
+{
+        $a = 5;
+        return $a;
+}
+foo(bar));
+
+foo($a = 5) // 표현식(Expression)은 변수가 아니다.
+foo(5) // 상수(Constant)는 변수가 아니가.
+     </programlisting>                 </informalexample> 이 모든것은 PHP 4.0.4 
+이상의 버젼에 해당된다.  </para>        </sect1>        <sect1 
+id="language.references.return">         <title>참조값 리턴(Returning 
+References)</title>           <para>   참조값 리턴은 변수가 어떤값을 
+참조하는 지를 찾는 함수를 사용할때    유용하다. 참조값 
+리턴의 문법은 다음과 같다<informalexample>                          
+<programlisting role="php">
+function &amp;find_var ($param) {
+    ...code...
+    return $found_var;
+}
+
+$foo =&amp; find_var ($bar);
+$foo->x = 2; 
+     </programlisting>                 </informalexample>  위의 예에서 
+함수<varname>find_var</varname>에 의해 리턴된 객체의 속성은 
+복사되어 지는 것이 아니라 정의(set)되어 진다.참조의 문법을 
+사용하지 않고도 가능하다.</para>            <note>                  
+<simpara>   참조값 리턴 이라는 것을 표시 하기위해 인수전달과는 
+달리 함수를 호출하는    쪽과 호출되어지는 함수 양쪽에     
+<literal>&amp;</literal>기호가 있어야 한다. 이로 인해 일반적으로 
+함수값의 리턴방식인 복사에 의한 방법이 아니라 참조를 사용한 
+리턴이<varname>$foo</varname>로 가능해 진 것이다.
+    </simpara>         </note> </sect1>        <sect1 id="language.references.unset"> 
+         <title>참조지시 없애기(Unsetting References)</title>             
+<para>   참조된 값을 없애려면 변수명과 그가 가리키는 
+내용(content)와의 연결고리를    끊으면 된다. 이렇게 한다고 해서 
+변수가 가리키는 내용 자체가 없어진다는 것을   의미하지는 
+않는다. 아래의 예를 보자:
+    <informalexample>                          <programlisting role="php">
+$a = 1;
+$b =&amp; $a;
+unset ($a); 
+     </programlisting>                 </informalexample>   
+변수<varname>$b</varname>의 참조된 값을 없앤것이 아니라 단지 
+변수<varname>$a</varname>가 지시하는 것을 없앴다. 
+   </para>             <simpara>   다시말해, 이는 Unix 시스템에서     
+<command>unlink</command>를 호출하는 것과 상당히 유사하다.   </simpara> 
+</sect1>        <sect1 id="language.references.spot">           <title>Spotting 
+References</title>              <simpara>
+    Many syntax constructs in PHP are implemented via referencing
+    mechanisms, so everything told above about reference binding also
+    apply to these constructs. Some constructs, like passing and
+    returning by-reference, are mentioned above. Other constructs that
+    use references are:
+   </simpara>          <sect2 id="references.global">                  <title>        
+                 <literal>global</literal> References</title>                    
+<para>
+     When you declare variable as <command>global $var</command> you
+     are in fact creating reference to a global variable. That means,
+     this is the same as:
+     <informalexample>                                 <programlisting role="php">
+$var =&amp; $GLOBALS["var"];
+      </programlisting>                                </informalexample>             
+         </para>                 <simpara>
+     That means, for example, that unsetting <varname>$var</varname>
+     won't unset global variable.
+    </simpara>         </sect2>                <sect2 id="references.this">           
+         <title>                         <literal>$this</literal>                     
+   </title>                        <simpara>
+     In an object method, <varname>$this</varname> is always reference
+     to the caller object.
+    </simpara>         </sect2>        </sect1></chapter><!-- Keep this comment at 
+the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+sgml-parent-document:nil
+sgml-default-dtd-file:"../../manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->
\ No newline at end of file
Index: phpdoc/kr/language/variables.xml
diff -u phpdoc/kr/language/variables.xml:1.1 phpdoc/kr/language/variables.xml:1.2
--- phpdoc/kr/language/variables.xml:1.1        Tue Jan  9 00:23:41 2001
+++ phpdoc/kr/language/variables.xml    Mon Jan 29 18:25:41 2001
@@ -1,64 +1,22 @@
-<chapter id="language.variables">
-       <title>변수 (Variables)</title>
-       <sect1 id="language.variables.basics">
-               <title>기본(Basics)</title>
-               <simpara>
-    Variables in PHP are represented by a dollar sign followed by the
-    name of the variable. The variable name is case-sensitive.
-   </simpara>
-               <para>
-    Variable names follow the same rules as other labels in PHP. A
-    valid variable name starts with a letter or underscore, followed
-    by any number of letters, numbers, or underscores. As a regular
-    expression, it would be expressed thus:
-    '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
-   </para>
-               <note>
-                       <simpara>
-     For our purposes here, a letter is a-z, A-Z, and the ASCII
-     characters from 127 through 255 (0x7f-0xff).
-    </simpara>
-               </note>
-               <para>
-                       <informalexample>
-                               <programlisting role="php"> 
+<!-- edited with XML Spy v3.0.7 (http://www.xmlspy.com) by panda (bra) --><chapter 
+id="language.variables">    <title>변수 (Variables)</title>       <sect1 
+id="language.variables.basics">          <title>기본(Basics)</title>           
+<simpara>   PHP에서 변수는 이름앞에 달러표시($)를 붙여서 
+사용한다.   또한 변수명에 있어 대소문자도 구분한다.   </simpara> 
+        <para>   변수명은 PHP내의 다른 라벨명을 정의하는 것과 
+동일한 규칙을 적용 받는다.   유효한 변수명은 문자나 혹은 
+언더스코아(_)로 시작하여야 하고, 두번째 문자부터는   문자나 
+숫자,언더스코아등을 사용할수 있고 길이에는 제한이 없다.   
+정규식으로 표현하자면 다음과 같이 나타낼수 있다.    
+'[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
+   </para>             <note>                  <simpara>
+      a-z, A-Z 사이의 알파벳과 ASCII code 127부터 255까지를 의미한다 
+(0x7f-0xff).
+    </simpara>         </note>         <para>                  <informalexample>      
+                         <programlisting role="php"> 
 $var = "Bob";
 $Var = "Joe";
-echo "$var, $Var";      // outputs "Bob, Joe"
+echo "$var, $Var";      // 결과값은 "Bob, Joe"
 
-$4site = 'not yet';     // invalid; starts with a number
-$_4site = 'not yet';    // valid; starts with an underscore
-$t㸴e = 'mansikka';    // valid; '⥠is ASCII 228.
-     </programlisting>
-                       </informalexample>
-               </para>
-               <para>
-    In PHP 3, variables are always assigned by value. That is to say,
-    when you assign an expression to a variable, the entire value of
-    the original expression is copied into the destination
-    variable. This means, for instance, that after assigning one
-    variable's value to another, changing one of those variables will
-    have no effect on the other. For more information on this kind of
-    assignment, see <link linkend="language.expressions">Expressions</link>.
-   </para>
-               <para>
-    PHP 4 offers another way to assign values to variables:
-    <emphasis>assign by reference</emphasis>. This means that the new
-    variable simply references (in other words, "becomes an alias for"
-    or "points to") the original variable. Changes to the new variable
-    affect the original, and vice versa. This also means that no
-    copying is performed; thus, the assignment happens more
-    quickly. However, any speedup will likely be noticed only in tight
-    loops or when assigning large arrays or objects.
-   </para>
-               <para>
+$4site = 'not yet';     // 변수명이 숫자로 시작했으므로 규칙에 
+위배된다
+$_4site = 'not yet';    // 언더스코아로 시작된 변수는 사용할수 있다.
+$t_e = 'mansikka';    // '_는 ASCII 228번째 문자이므로 유효하다.
+     </programlisting>                 </informalexample>              </para>        
+ <para>    PHP 3 에서 변수는 항상 값을 가지고 있다. 이는 
+다시말해서,    표현식의 값을 변수에 적용하면 표현식의 
+결과값이 변수로 복사된다.    표현식의 값을 변수에 복사하므로 
+복사되고 난 후에 표현식의 변화는    변수에 더이상 영향을 
+주지 않는다고 할수 있다.    이에 대한 자세한 설명은 <link 
+linkend="language.expressions">표현식(Expressions)</link>을 참조하기 
+바란다.
+   </para>             <para>   PHP 4 에서는 변수에 값을 지정하는 다른 
+방법을 제시하고 있다:    <emphasis>참조(reference)를 사용한 값 
+지정(assign)</emphasis>. 이는 새로운 변수가 값을 복사하여 가지고 
+오는 것이 아니라   원래 값이 있는 곳을 단순히 참조하는 
+방법이다. 원래 값이 있는 변수의   별칭이 된다라고 할수도 
+있고 원래 변수를 가리킨다고 표현할 수도 있겠다.  새로운 
+변수값의 변화는 원래변수의 값에 영향을 주고 반대로 
+원래변수의   값이 변하여도 새로운 변수에 영향을 미친다. 결코 
+값을 복사하는 것과는   다른 개념이라 할수 있다. 따라서 
+크기가 큰 배열이나 객체를 지정할때나   반복문을 수행하는데 
+있어 수행속도가 빨라졌다.   </para>             <para>
     To assign by reference, simply prepend an ampersand (&amp;) to the
     beginning of the variable which is being assigned (the source
     variable). For instance, the following code snippet outputs 'My
     name is Bob' twice:
 
-    <informalexample>
-                               <programlisting role="php">
+    <informalexample>                          <programlisting role="php">
 &lt;?php
 $foo = 'Bob';              // Assign the value 'Bob' to $foo
 $bar = &amp;$foo;          // Reference $foo via $bar.
@@ -66,14 +24,10 @@
 echo $foo;                 // $foo is altered too.
 echo $bar;
 ?&gt;
-     </programlisting>
-                       </informalexample>
-               </para>
-               <para>
+     </programlisting>                 </informalexample>              </para>        
+ <para>
     One important thing to note is that only named variables may be
     assigned by reference.
-    <informalexample>
-                               <programlisting role="php">
+    <informalexample>                          <programlisting role="php">
 &lt;?php
 $foo = 25;
 $bar = &amp;$foo;      // This is a valid assignment.
@@ -85,172 +39,66 @@
 
 $bar = &amp;test();    // Invalid.
 ?&gt;
-     </programlisting>
-                       </informalexample>
-               </para>
-       </sect1>
-       <sect1 id="language.variables.predefined">
-               <title>미리 정의된 변수 (Predefined variables)</title>
-               <simpara>
-       PHP는 모든 스크립트에 대해 그 스크립트가 실행 될 때 
여러개의 미리 정의된 변수를 제공한다. 
-       이 변수중 서버의 종류나 버전, 기타 다른 요인으로 인해 
달라지는 것도 많은데, 그런 변수는 이곳에 문서화 되지 않았다. 
-       또한 이 변수중 다수는 PHP가 command-line으로 동작할 때는 
사용할 수 없다.
-   </simpara>
-               <simpara>
+     </programlisting>                 </informalexample>              </para> 
+</sect1>        <sect1 id="language.variables.predefined">              <title>미리 
+정의된 변수 (Predefined variables)</title>           <simpara>PHP는 모든 
+스크립트에 대해 그 스크립트가 실행 될 때 여러개의 미리 
+정의된 변수를 제공한다. 
+이 변수중 서버의 종류나 버전, 기타 다른 요인으로 인해 
+달라지는 것도 많은데, 그런 변수는 이곳에 문서화 되지 않았다. 
+또한 이 변수중 다수는 PHP가 command-line으로 동작할 때는 사용할 
+수 없다.
+   </simpara>          <simpara>
        이런 여러 요인이 있지만 이곳에서는 가장 일반적인 
환경인 <ulink url="&url.apache;">Apache</ulink> 1.3.6 에서 
        모듈로 PHP3를 설치한 환경에서의 미리 정의된 변수를 
살펴보도록 하자.
-   </simpara>
-               <simpara>
+   </simpara>          <simpara>
        여러분이 사용하는 시스템의 모든 미리 정의된 변수를 
보려면 <function>phpinfo</function> 함수를 사용하자. 
        (이 함수는 다른 여러 유용한 정보도 알려준다.)
-   </simpara>
-               <note>
-                       <simpara>
+   </simpara>          <note>                  <simpara>
        여기나온 목록은 완전하지 않다. (완벽할 생각도 없다.) 
        이 목록은 단순히 여러분의 스크립트에서 어떤 종류의 
미리 정의된 변수가 사용될 수 있는가의 예시일 뿐이다.
-    </simpara>
-               </note>
-               <sect2 id="language.variables.predefined.apache">
-                       <title>Apache variables</title>
-                       <simpara>
+    </simpara>         </note>         <sect2 
+id="language.variables.predefined.apache">                       <title>Apache 
+variables</title>                 <simpara>
        이 변수는 <ulink url="&url.apache;">Apache</ulink> 웹서버로부터 
생성된 것이다. 
        만약 여러분이 다른 웹서버를 사용하고 있다면 이와 
동일한 변수가 생성된다고 보장할 수 없다. 
        아마도 일부는 없어지고, 여기에 없는 변수가 새로 생길 
것이다. 
        여기에 있는 변수중 대부분은 <ulink url="&url.cgispec;">CGI 1.1
      specification</ulink>에서 나온 것이고, 그 내용대로 사용된다.
-    </simpara>
-                       <simpara>
+    </simpara>                 <simpara>
        이곳에 있는 변수중 PHP가 command line으로 동작할 경우 
사용될 수 있는 것은 거의 없다.
-    </simpara>
-                       <para>
-                               <variablelist>
-                                       <varlistentry>
-                                               <term>GATEWAY_INTERFACE</term>
-                                               <listitem>
-                                                       <simpara>
+    </simpara>                 <para>                          <variablelist>         
+                         <varlistentry>                                          
+<term>GATEWAY_INTERFACE</term>                                          <listitem>    
+                                                  <simpara>
                서버가 사용하고 있는 CGI specification의 revision. 예: 
'CGI/1.1'. 
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>SERVER_NAME</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>SERVER_NAME</term>      
+                                          <listitem>                                  
+                    <simpara>
                현재 스크립트가 실행되고 있는 호스트의 이름. 
                만약 스크립트가 가상 호스트에서 실행되고 있다면, 
이 값은 가상 호스트의 값이 될 것이다.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>SERVER_SOFTWARE</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>SERVER_SOFTWARE</term>  
+                                          <listitem>                                  
+                    <simpara>
                요구에 대한 대답의 헤더에 사용할 서버 identification 
문자열
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>SERVER_PROTOCOL</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>SERVER_PROTOCOL</term>  
+                                          <listitem>                                  
+                    <simpara>
                페이지가 요구되어질 때 사용한 프로토콜의 이름과 
리비젼. 예: 'HTTP/1.0'; 
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>REQUEST_METHOD</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>REQUEST_METHOD</term>   
+                                          <listitem>                                  
+                    <simpara>
          Which request method was used to access the page; i.e. 'GET',
          'HEAD', 'POST', 'PUT'.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>QUERY_STRING</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>QUERY_STRING</term>     
+                                          <listitem>                                  
+                    <simpara>
                해당 페이지를 접근할 때 사용된 query string.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>DOCUMENT_ROOT</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>DOCUMENT_ROOT</term>    
+                                          <listitem>                                  
+                    <simpara>
          현재 스크립트가 샐행중인 document root 디렉토리. 서버의 
설정 파일에 정의되어 있다.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>HTTP_ACCEPT</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>HTTP_ACCEPT</term>      
+                                          <listitem>                                  
+                    <simpara>
          Contents of the <literal>Accept:</literal> header from the
          current request, if there is one.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>HTTP_ACCEPT_CHARSET</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          
+<term>HTTP_ACCEPT_CHARSET</term>                                                
+<listitem>                                                      <simpara>
          Contents of the <literal>Accept-Charset:</literal> header
          from the current request, if there is one. Example:
          'iso-8859-1,*,utf-8'.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>HTTP_ENCODING</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>HTTP_ENCODING</term>    
+                                          <listitem>                                  
+                    <simpara>
          Contents of the <literal>Accept-Encoding:</literal> header
          from the current request, if there is one. Example: 'gzip'.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>HTTP_ACCEPT_LANGUAGE</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          
+<term>HTTP_ACCEPT_LANGUAGE</term>                                               
+<listitem>                                                      <simpara>
          Contents of the <literal>Accept-Language:</literal> header
          from the current request, if there is one. Example: 'en'.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>HTTP_CONNECTION</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>HTTP_CONNECTION</term>  
+                                          <listitem>                                  
+                    <simpara>
          Contents of the <literal>Connection:</literal> header from
          the current request, if there is one. Example: 'Keep-Alive'.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>HTTP_HOST</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>HTTP_HOST</term>        
+                                  <listitem>                                          
+            <simpara>
          Contents of the <literal>Host:</literal> header from the
          current request, if there is one.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>HTTP_REFERER</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>HTTP_REFERER</term>     
+                                          <listitem>                                  
+                    <simpara>
          The address of the page (if any) which referred the browser
          to the current page. This is set by the user's browser; not
          all browsers will set this.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>HTTP_USER_AGENT</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>HTTP_USER_AGENT</term>  
+                                          <listitem>                                  
+                    <simpara>
          Contents of the <literal>User_Agent:</literal> header from
          the current request, if there is one. This is a string
          denoting the browser software being used to view the current
@@ -259,128 +107,57 @@
          this value with <function>get_browser</function> to tailor
          your page's functionality to the capabilities of the user's
          browser.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>REMOTE_ADDR</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>REMOTE_ADDR</term>      
+                                          <listitem>                                  
+                    <simpara>
          The IP address from which the user is viewing the current
          page.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>REMOTE_PORT</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>REMOTE_PORT</term>      
+                                          <listitem>                                  
+                    <simpara>
          The port being used on the user's machine to communicate with
          the web server.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>SCRIPT_FILENAME</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>SCRIPT_FILENAME</term>  
+                                          <listitem>                                  
+                    <simpara>
          The absolute pathname of the currently executing script.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>SERVER_ADMIN</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>SERVER_ADMIN</term>     
+                                          <listitem>                                  
+                    <simpara>
          The value given to the SERVER_ADMIN (for Apache) directive in
          the web server configuration file. If the script is running
          on a virtual host, this will be the value defined for that
          virtual host.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>SERVER_PORT</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>SERVER_PORT</term>      
+                                          <listitem>                                  
+                    <simpara>
          The port on the server machine being used by the web server
          for communication. For default setups, this will be '80';
          using SSL, for instance, will change this to whatever your
          defined secure HTTP port is.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>SERVER_SIGNATURE</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>SERVER_SIGNATURE</term> 
+                                          <listitem>                                  
+                    <simpara>
          String containing the server version and virtual host name
          which are added to server-generated pages, if enabled.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>PATH_TRANSLATED</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>PATH_TRANSLATED</term>  
+                                          <listitem>                                  
+                    <simpara>
          Filesystem- (not document root-) based path to the current
          script, after the server has done any virtual-to-real
          mapping.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>SCRIPT_NAME</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>SCRIPT_NAME</term>      
+                                          <listitem>                                  
+                    <simpara>
          Contains the current script's path. This is useful for pages
          which need to point to themselves.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>REQUEST_URI</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>REQUEST_URI</term>      
+                                          <listitem>                                  
+                    <simpara>
          The URI which was given in order to access this page; for
          instance, '/index.html'.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                               </variablelist>
-                       </para>
-               </sect2>
-               <sect2 id="language.variables.predefined.environment">
-                       <title>Environment variables</title>
-                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                         </variablelist>      
+           </para>         </sect2>                <sect2 
+id="language.variables.predefined.environment">                  <title>Environment 
+variables</title>                    <simpara>
      These variables are imported into PHP's global namespace from the
      environment under which the PHP parser is running. Many are
      provided by the shell under which PHP is running and different
      systems are likely running different kinds of shells, a
      definitive list is impossible. Please see your shell's
      documentation for a list of defined environment variables.
-    </simpara>
-                       <simpara>
+    </simpara>                 <simpara>
      Other environment variables include the CGI variables, placed
      there regardless of whether PHP is running as a server module or
      CGI processor.
-    </simpara>
-               </sect2>
-               <sect2 id="language.variables.predefined.php">
-                       <title>PHP variables</title>
-                       <simpara>
+    </simpara>         </sect2>                <sect2 
+id="language.variables.predefined.php">                  <title>PHP variables</title> 
+                   <simpara>
      These variables are created by PHP itself. The
      <varname>$HTTP_*_VARS</varname> variables are available only if
      the <link linkend="ini.track-vars">track_vars</link>
      configuration is turned on.
-    </simpara>
-                       <note>
-                               <para>
+    </simpara>                 <note>                          <para>
       As of PHP 4.0.3, <link linkend="ini.track-vars">track_vars</link> is always 
turned on,
       regardless of the configuration file setting.
-     </para>
-                       </note>
-                       <para>
+     </para>                   </note>                 <para>
      If the <link linkend="ini.register-globals">register_globals</link> directive
      is set, then these variables will also be made available in the
      global scope of the script; i.e., separate from the
@@ -391,124 +168,53 @@
      possibly malicious intent. If you cannot turn off <link 
linkend="ini.register-globals">register_globals</link>, you must
      take whatever steps are necessary to ensure that the data you are
      using is safe.
-    </para>
-                       <para>
-                               <variablelist>
-                                       <varlistentry>
-                                               <term>argv</term>
-                                               <listitem>
-                                                       <simpara>
+    </para>                    <para>                          <variablelist>         
+                         <varlistentry>                                          
+<term>argv</term>                                               <listitem>            
+                                          <simpara>
          Array of arguments passed to the script. When the script is
          run on the command line, this gives C-style access to the
          command line parameters. When called via the GET method, this
          will contain the query string.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>argc</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>argc</term>             
+                                  <listitem>                                          
+            <simpara>
          Contains the number of command line parameters passed to the
          script (if run on the command line).
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>PHP_SELF</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>PHP_SELF</term>         
+                                  <listitem>                                          
+            <simpara>
          The filename of the currently executing script, relative to
          the document root. If PHP is running as a command-line
          processor, this variable is not available.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>HTTP_COOKIE_VARS</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>HTTP_COOKIE_VARS</term> 
+                                          <listitem>                                  
+                    <simpara>
          An associative array of variables passed to the current
          script via HTTP cookies. 
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>HTTP_GET_VARS</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>HTTP_GET_VARS</term>    
+                                          <listitem>                                  
+                    <simpara>
          An associative array of variables passed to the current
          script via the HTTP GET method.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>HTTP_POST_VARS</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>HTTP_POST_VARS</term>   
+                                          <listitem>                                  
+                    <simpara>
          An associative array of variables passed to the current
          script via the HTTP POST method.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>HTTP_POST_FILES</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>HTTP_POST_FILES</term>  
+                                          <listitem>                                  
+                    <simpara>
          An associative array of variables containing information
          about files uploaded via the HTTP POST method. See <link 
linkend="features.file-upload.post-method">POST method
          uploads</link> for information on the contents of
          <varname>$HTTP_POST_FILES</varname>.
-        </simpara>
-                                                       <para>
-                                                               
<varname>$HTTP_POST_FILES</varname> is available only in PHP
+        </simpara>                                                     <para>         
+                                                 <varname>$HTTP_POST_FILES</varname> 
+is available only in PHP
          4.0.0 and later.
-        </para>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>HTTP_ENV_VARS</term>
-                                               <listitem>
-                                                       <simpara>
+        </para>                                                </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>HTTP_ENV_VARS</term>    
+                                          <listitem>                                  
+                    <simpara>
          An associative array of variables passed to the current
          script via the parent environment. 
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                                       <varlistentry>
-                                               <term>HTTP_SERVER_VARS</term>
-                                               <listitem>
-                                                       <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                                 
+<varlistentry>                                          <term>HTTP_SERVER_VARS</term> 
+                                          <listitem>                                  
+                    <simpara>
          An associative array of variables passed to the current
          script from the HTTP server. These variables are analogous to
          the Apache variables described above.
-        </simpara>
-                                               </listitem>
-                                       </varlistentry>
-                               </variablelist>
-                       </para>
-               </sect2>
-       </sect1>
-       <sect1 id="language.variables.scope">
-               <title>변수 사용 범위 (Variable Scope)</title>
-               <simpara>
+        </simpara>                                             </listitem>            
+                         </varlistentry>                         </variablelist>      
+           </para>         </sect2>        </sect1>        <sect1 
+id="language.variables.scope">           <title>변수 사용 범위 (Variable 
+Scope)</title>            <simpara>
        변수가 사용가능한 곳은 그 변수가 선언된 곳 안에서 
만이다. 
        PHP 변수의 대부분은 한 개의 범위(single scope)만을 가지고 
있다. 
        이 범위는 include나 require되어서 읽혀온 파일에도 동일하게 
적용된다. 예를들어 :
-   </simpara>
-               <informalexample>
-                       <programlisting role="php">
+   </simpara>          <informalexample>                       <programlisting 
+role="php">
 $a = 1;
 include "b.inc";
-    </programlisting>
-               </informalexample>
-               <simpara>
+    </programlisting>          </informalexample>              <simpara>
        위에서 <varname>$a</varname>변수는 <filename>b.inc</filename> 
스크립트에서도 사용할 수 있다.
        기본적으로 함수 안에서 선언된 것은 함수 안에서만 
사용되는 지역 변수이다. 
        또한 함수 안에서 사용되는 함수들은 기본적으로 지역 
변수라고 가정하고 찾게 된다. 예를 들어:
-   </simpara>
-               <informalexample>
-                       <programlisting role="php"> 
+   </simpara>          <informalexample>                       <programlisting 
+role="php"> 
 $a = 1; /* global scope */ 
 
 Function Test () { 
@@ -516,16 +222,12 @@
 } 
 
 Test ();
-    </programlisting>
-               </informalexample>
-               <simpara>
+    </programlisting>          </informalexample>              <simpara>
        이 스크립트는 함수 안의 <varname>$a</varname> 변수를 
지역변수로 가정하였고, 
        지역변수 $a에는 아무 값도 대입되지 않았기 때문에 아무런 
출력도 나타나지 않는다. 
        이것은 C와는 약간 차이가 나는 부분이다. 
        PHP에서 전역변수를 사용하려면 사용하고 싶은 전역 변수를 
함수 안에 global 선언을 해 주어야 한다. 예를 들어 : 
-               </simpara>
-               <informalexample>
-                       <programlisting role="php">
+               </simpara>              <informalexample>                       
+<programlisting role="php">
 $a = 1;
 $b = 2;
 
@@ -537,20 +239,15 @@
 
 Sum ();
 echo $b;
-    </programlisting>
-               </informalexample>
-               <simpara>
+    </programlisting>          </informalexample>              <simpara>
        위의 스크립트는 &quot;3&quot;을 출력할 것이다. 
        함수 내에서 <varname>$a</varname>와 <varname>$b</varname>를 global로 
선언했으므로, 
        이 함수내의 $a, $b는 전역 변수를 참조하게 된다. 
        함수 내에서 다룰 수 있는 전역변수의 개수에는 제한이 
없다.
-   </simpara>
-               <simpara>
+   </simpara>          <simpara>
        전역 변수를 참조하는 두 번째 방법은 PHP에서 특별히 
정의하고 있는 $GLOBALS라는 배열을 사용하는 것이다. 
        위의 예를 다음과 같이 바꿔 쓸 수 있다. : 
-   </simpara>
-               <informalexample>
-                       <programlisting role="php">
+   </simpara>          <informalexample>                       <programlisting 
+role="php">
 $a = 1;
 $b = 2;
 
@@ -560,26 +257,18 @@
 
 Sum ();
 echo $b;
-    </programlisting>
-               </informalexample>
-               <simpara>
-       <varname>$GLOBALS</varname> 배열은 변수이름이 Key가 되고, 
+    </programlisting>          </informalexample>              <simpara>              
+         <varname>$GLOBALS</varname> 배열은 변수이름이 Key가 되고, 
        그 변수의 내용이 값이 되는 원소를 가진 associative 
배열이다.
-   </simpara>
-               <simpara>
+   </simpara>          <simpara>
        변수 범위와 관련하여 알아두어야 할 또 다른 내용으로 
<emphasis>정적</emphasis> 변수(static variable)가 있다다. 
        정적 변수는 지역 함수 내에서만 존재하지만 지역 함수가 
종료되어도 그 값을 읽어버리지 않고 가지고 있다. 다음 예를 
보자 : 
-   </simpara>
-               <informalexample>
-                       <programlisting role="php">
+   </simpara>          <informalexample>                       <programlisting 
+role="php">
 Function Test () {
     $a = 0;
     echo $a;
     $a++;
 }
-    </programlisting>
-               </informalexample>
-               <simpara>
+    </programlisting>          </informalexample>              <simpara>
     This function is quite useless since every time it is called it
     sets <varname>$a</varname> to <literal>0</literal> and prints
     &quot;0&quot;.  The <varname>$a</varname>++ which increments the
@@ -587,30 +276,23 @@
     <varname>$a</varname> variable disappears.  To make a useful
     counting function which will not lose track of the current count,
     the <varname>$a</varname> variable is declared static:
-   </simpara>
-               <informalexample>
-                       <programlisting role="php">
+   </simpara>          <informalexample>                       <programlisting 
+role="php">
 Function Test () {
     static $a = 0;
     echo $a;
     $a++;
 }
-    </programlisting>
-               </informalexample>
-               <simpara>
+    </programlisting>          </informalexample>              <simpara>
     Now, every time the Test() function is called it will print the
     value of <varname>$a</varname> and increment it.
-   </simpara>
-               <simpara>
+   </simpara>          <simpara>
        또한 정적 변수는 다음과 같이 recursion에서 반드시 
필요하다. 
        재귀적인 함수는 자기 자신의 함수를 호출하는 것을 
말한다. 
        재귀적인 함수를 사용할 때는 무한 루프에 빠질 수 있기 
때문에 매우 주의를 요한다. 
        따라서 여러분은 재귀 호출을 끝내는 적절한 방법을 
마련해 두어야 한다. 
        다음의 간단한 예제는 10번의 재귀적 호출을 한다. 
        정적 변수 <varname>$count</varname>를 사용하여 중단될 시기를 
알 수 있다.
-   </simpara>
-               <informalexample>
-                       <programlisting role="php">
+   </simpara>          <informalexample>                       <programlisting 
+role="php">
 Function Test () {
     static $count = 0;
 
@@ -621,50 +303,28 @@
     }
     $count--;
 }
-    </programlisting>
-               </informalexample>
-       </sect1>
-       <sect1 id="language.variables.variable">
-               <title>가변 변수 (Variable variables)</title>
-               <simpara>
+    </programlisting>          </informalexample>      </sect1>        <sect1 
+id="language.variables.variable">                <title>가변 변수 (Variable 
+variables)</title>               <simpara>
        가끔 변수의 이름을 변경할 수 있다면 편리하다고 느낄 
때가 있다. 
        이제 변수의 이름을 바꾸어 사용하는 방법을 알아보자. 
보통의 변수 선언은 다음과 같다.:
-   </simpara>
-               <informalexample>
-                       <programlisting role="php">
+   </simpara>          <informalexample>                       <programlisting 
+role="php">
 $a = "hello";
-    </programlisting>
-               </informalexample>
-               <simpara>
+    </programlisting>          </informalexample>              <simpara>
        가변 변수은 변수의 값을 가질 수도 있고, 또한 이 값을 
변수의 이름으로 다룰 수도 있다. 
        위의 예에서 $$를 사용하면 <emphasis>hello</emphasis>가 변수 
이름이 될 수 있다. 예 : 
-   </simpara>
-               <informalexample>
-                       <programlisting role="php">
+   </simpara>          <informalexample>                       <programlisting 
+role="php">
 $$a = "world";
-    </programlisting>
-               </informalexample>
-               <simpara>
+    </programlisting>          </informalexample>              <simpara>
        이렇게 하면 PHP의 symbol tree에는 "hello"라는 값을 가지는 
<varname>$a</varname>와 "world"라는 값을 가지는 
        <varname>$hello</varname>의 두 개의 변수가 생기게 된다. 
그러므로 다음과 같은 문장은 :
-   </simpara>
-               <informalexample>
-                       <programlisting role="php">
+   </simpara>          <informalexample>                       <programlisting 
+role="php">
 echo "$a ${$a}";
-    </programlisting>
-               </informalexample>
-               <simpara>
+    </programlisting>          </informalexample>              <simpara>
     다음 문장과 똑 같은 출력을 나타내게 된다.:
-   </simpara>
-               <informalexample>
-                       <programlisting>
+   </simpara>          <informalexample>                       <programlisting>
 echo "$a $hello";
-    </programlisting>
-               </informalexample>
-               <simpara>
+    </programlisting>          </informalexample>              <simpara>
     i.e. 둘의 출력: <computeroutput>hello world</computeroutput>.
-   </simpara>
-               <simpara>
+   </simpara>          <simpara>
        가변 변수를 배열과 함께 사용하려면, 한가지 모호성 
문제를 해결해야 한다. 
        그것은, 만약 여러분이 <varname>$$a[1]</varname>이라고 썼으면,
        <varname>$a[1]</varname>을 하나의 변수로 볼 것인지, 
@@ -672,51 +332,32 @@
        다음과 같이 하여 모호성을 해결하자. 전자의 경우 
<varname>${$a[1]}</varname>라고 쓰고, 
        후자의 경우는 <varname>${$a}[1]</varname>라고 쓰면 된다. 
        ( 역자주: 가변 변수를 나타낼 때는 항상 { }로 둘러 싸는 
것이 보기 좋고 오류도 없앨 수 있다.)
-   </simpara>
-       </sect1>
-       <sect1 id="language.variables.external">
-               <title>PHP 밖에서 온 변수들 (Variables from outside PHP)</title>
-               <sect2 id="language.variables.external.form">
-                       <title>HTML Forms (GET and POST)</title>
-                       <simpara>
+   </simpara>  </sect1>        <sect1 id="language.variables.external">               
+ <title>PHP 밖에서 온 변수들 (Variables from outside PHP)</title>         
+<sect2 id="language.variables.external.form">                   <title>HTML Forms 
+(GET and POST)</title>                        <simpara>
        폼이 PHP 스크립트로 submit되면 폼에 있는 모든 내용들이 
자동적으로 만들어진 PHP 변수로 들어온다. 
        만약 <link linkend="ini.track-vars">track_vars</link> 옵션이 on으로 
설정되어 있으면,
        이 변수들 모두는 그것이 어디서 만들어진 것이냐에 
따라서 <varname>$HTTP_POST_VARS</varname>,
      <varname>$HTTP_GET_VARS</varname>, <varname>$HTTP_POST_FILES</varname>의 
associative 배열에 위치하게 된다.
-    </simpara>
-                       <para>
+    </simpara>                 <para>
        이 변수에대한 자세한 설명은 <link 
linkend="language.variables.predefined">미리 정의된 변수 
        (Predefined variables)</link>을 읽어보기 바란다.
-    </para>
-                       <para>
-                               <example>
-                                       <title>Simple form variable</title>
-                                       <programlisting role="php">
+    </para>                    <para>                          <example>              
+                         <title>Simple form variable</title>                          
+           <programlisting role="php">
 &lt;form action="foo.php" method="post">
     Name: &lt;input type="text" name="username">&lt;br>
     &lt;input type="submit">
 &lt;/form>
-      </programlisting>
-                               </example>
-                       </para>
-                       <para>
+      </programlisting>                                </example>                     
+ </para>                 <para>
 
      When the above form is submitted, the value from the text input
      will be available in
      <varname>$HTTP_POST_VARS['username']</varname>. If the <link 
linkend="ini.register-globals">register_globals</link>
      configuration directive is turned on, then the variable will also
      be available as <varname>$username</varname> in the global scope.
-    </para>
-                       <simpara>
+    </para>                    <simpara>
      PHP also understands arrays in the context of form variables. You
      may, for example, group related variables together, or use this
      feature to retrieve values from a multiple select
      input:
-    </simpara>
-                       <para>
-                               <example>
-                                       <title>More complex form variables</title>
-                                       <programlisting role="php">
+    </simpara>                 <para>                          <example>              
+                         <title>More complex form variables</title>                   
+                   <programlisting role="php">
 &lt;form action="array.php" method="post">
     Name: &lt;input type="text" name="personal[name]">&lt;br>
     Email: &lt;input type="text" name="personal[email]">&lt;br>
@@ -728,34 +369,19 @@
         &lt;/select>
     &lt;input type="submit">
 &lt;/form>
-      </programlisting>
-                               </example>
-                       </para>
-                       <para>
+      </programlisting>                                </example>                     
+ </para>                 <para>
      In PHP 3, the array form variable usage is limited to
      single-dimensional arrays. In PHP 4, no such restriction applies.
-    </para>
-                       <sect3 id="language.variables.external.form.submit">
-                               <title>IMAGE SUBMIT의 변수 이름</title>
-                               <simpara>
+    </para>                    <sect3 id="language.variables.external.form.submit">   
+                         <title>IMAGE SUBMIT의 변수 이름</title>                 
+           <simpara>
        폼은 submit할 때 일반적으로 사용하는 submit 버튼 대신 
다음과 같이 그림을 사용할 수도 있다. :
-                               </simpara>
-                               <informalexample>
-                                       <programlisting role="php">
+                               </simpara>                              
+<informalexample>                                       <programlisting role="php">
 &lt;input type=image src="image.gif" name="sub">
-      </programlisting>
-                               </informalexample>
-                               <simpara>
+      </programlisting>                                </informalexample>             
+                 <simpara>
        사용자가 image를 클릭하면, 폼은 sub_x와 sub_y의 두 개의 
변수가 추가되어 서버에 전송된다. 
        이 두 변수는 이미지에서 사용자가 click한 위치 정보를 
담고 있다. 
        일부 브라우저에서는 밑줄(_)대신 마침표(.)를 사용하는 
경우도 있는데, 
        PHP는 이런 경우 자동적을 마침표(.)를 밑줄(_)로 바꿔준다.
-     </simpara>
-                       </sect3>
-               </sect2>
-               <sect2 id="language.variables.external.cookies">
-                       <title>HTTP Cookies</title>
-                       <simpara>
+     </simpara>                        </sect3>                </sect2>               
+ <sect2 id="language.variables.external.cookies">                        <title>HTTP 
+Cookies</title>                     <simpara>
        PHP는 HTTP 쿠키를 <ulink url="&spec.cookies;">Netscape's Spec</ulink>의 
정의에 따라 제공한다. 
        Cookie 메카니즘은 트래킹이나 사용자 식별 등을 위해 원격 
browser에 저장된 데이터를 돌려 받는 과정을 말한다. 
        여러분은 cookie를 설정하기 위해 
<function>SetCookie</function>함수를 사용할 수 있다. 
@@ -763,52 +389,31 @@
        함수는 브라우저로 보내는 어떤 데이터보다도 앞에 
사용해야 한다. 
        이 제약은 <function>Header</function> 함수와 같은 제약으로 보면 
된다. 
        보낸 모든 cookie는 자동적으로 GET이나 POST 방식 데이터와 
같은 PHP 변수로 변환된다. 
-                       </simpara>
-                       <simpara>
+                       </simpara>                      <simpara>
        만약 여러분이 동일한 cookie에 여러 값을 저장하고 싶다면 
Cookie이름에 
        <emphasis>[]</emphasis>를 더하면 된다. 예를 들어 : 
-    </simpara>
-                       <informalexample>
-                               <programlisting role="php">
+    </simpara>                 <informalexample>                               
+<programlisting role="php">
 SetCookie ("MyCookie[]", "Testing", time()+3600);
-     </programlisting>
-                       </informalexample>
-                       <simpara>
+     </programlisting>                 </informalexample>                      
+<simpara>
        쿠키는 새로 설정하면 path나 도메인이 다르지 않는 한 
이전의 쿠키를 덮어쓰게 된다. 
        그러므로 쇼핑 카트 같은 응용 프로그램에서는 다음과 
같이 카운터를 사용하여, 
        이것을 기준으로 Cookie를 사용하는 것이 좋다. 예 : 
-    </simpara>
-                       <example>
-                               <title>SetCookie Example</title>
-                               <programlisting role="php">
+    </simpara>                 <example>                               
+<title>SetCookie Example</title>                                <programlisting 
+role="php">
 $Count++;
 SetCookie ("Count", $Count, time()+3600);
 SetCookie ("Cart[$Count]", $item, time()+3600);
-     </programlisting>
-                       </example>
-               </sect2>
-               <sect2 id="language.variables.external.environment">
-                       <title>환경 변수 (Environment variables)</title>
-                       <para>
+     </programlisting>                 </example>              </sect2>               
+ <sect2 id="language.variables.external.environment">                    
+<title>환경 변수 (Environment variables)</title>                    <para>
 
      PHP는 자동적으로 환경 변수들을 일반적인 PHP 변수로 만든다. 
 
-     <informalexample>
-                                       <programlisting role="php">
+     <informalexample>                                 <programlisting role="php">
 echo $HOME;  /* Shows the HOME environment variable, if set. */
-      </programlisting>
-                               </informalexample>
-                       </para>
-                       <para>
+      </programlisting>                                </informalexample>             
+         </para>                 <para>
        GET, POST, Cookie 메카니즘을 통해서 들어 온 정보로부터도 PHP 
변수가 생기므로, 
        때때로 환경변수로부터 받은것이 확실한가를 확인할 
필요가 있을 때도 있다.
        이를 위해 <function>getenv</function> 함수를 사용한다. 
        환경 변수를 설정하기 위해서는 <function>putenv</function> 
함수를 사용한다.
-    </para>
-               </sect2>
-               <sect2 id="language.variables.external.dot-in-names">
-                       <title>외부 변수명에 있는 '.' (Dots in incoming 
variable names)</title>
-                       <para>
+    </para>            </sect2>                <sect2 
+id="language.variables.external.dot-in-names">                   <title>외부 
+변수명에 있는 '.' (Dots in incoming variable names)</title>                 
+<para>
        일반적으로 PHP는 변수를 스크립트로 가져올 때 변수명을 
바꾸지 않는다. 
        그러나, PHP의 변수명에는 '.' (점)을 사용할 수 없다. 다음과 
같은 경우를 보자. :
      <programlisting role="php">
@@ -817,25 +422,16 @@
        위의 경우 PHP 파서는 <varname>$varname</varname>이라는 변수와, 
        연결 연산자, 'ext'(따옴표가 없는 경우 그것이 어떤 알려진 
키나 예약어가 아니면 문자열로 취급된다.)로 해석한다. 
        이것은 우리가 원하는 결과가 아니다.
-    </para>
-                       <para>
+    </para>                    <para>
        위와 같은 이유로 PHP는 외부에서 불러들인 변수의 이름에 
'.'이 있으면 '_'(밑줄)로 바꾸어 읽어들인다.
-    </para>
-               </sect2>
-               <sect2 id="language.variables.determining-type-of">
-                       <title>변수의 Type 판단 (Determining variable 
types)</title>
-                       <para>
+    </para>            </sect2>                <sect2 
+id="language.variables.determining-type-of">                     <title>변수의 
+Type 판단 (Determining variable types)</title>                       <para>
        PHP는 변수의 type을 알아서 정하고 (일반적으로) 필요한 
경우에는 그 type을 바꾸므로, 
        특정 시점에 그 변수 어떤 type인지는 쉽게 알 수 없다. 
        PHP는 변수의 type을 알아보기 위해 여러개의 함수를 가지고 
있다. 
        <function>gettype</function>, <function>is_long</function>,
      <function>is_double</function>, <function>is_string</function>,
      <function>is_array</function>, <function>is_object</function> 가 
그것들이다.
-    </para>
-               </sect2>
-       </sect1>
-</chapter>
-<!-- Keep this comment at the end of the file
+    </para>            </sect2>        </sect1></chapter><!-- Keep this comment at 
+the end of the file
  Local variables:
  mode: sgml
  sgml-omittag:t
@@ -850,4 +446,4 @@
  sgml-local-catalogs:nil
  sgml-local-ecat-files:nil
  End:
- -->
+ -->
\ No newline at end of file

Reply via email to