cvs: phpdoc /kr/language basic-syntax.xml

From: Date: Tue, 09 Jan 2001 04:43:55 +0000
Subject: cvs: phpdoc /kr/language basic-syntax.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969333496@lists.php.net to get a copy of this message
regina Mon Jan 8 20:43:55 2001 EDT Added files: /phpdoc/kr/language basic-syntax.xml Log: Index: phpdoc/kr/language/basic-syntax.xml +++ phpdoc/kr/language/basic-syntax.xml <!-- edited with XML Spy v2.5 NT - http://www.xmlspy.com --> <chapter id="language.basic-syntax"> <title>기본 문법(Basic syntax)</title> <sect1 id="language.basic-syntax.phpmode"> <title>HTML로부터 빠져나오기(Escaping from HTML)</title> <para> HTML로부터 빠져나와 "PHP code mode"로 들어가는 방법은 다음 4가지가 있다 : </para> <para> <example> <title>Ways of escaping from HTML</title> <programlisting> 1. &lt;? echo ("this is the simplest, an SGML processing instruction\n"); ?&gt; 2. &lt;?php echo("if you want to serve XHTML or XML documents, do like this\n"); ?&gt; 3. &lt;script language="php"&gt; echo ("some editors (like FrontPage) don't like processing instructions"); &lt;/script&gt; 4. &lt;% echo ("You may optionally use ASP-style tags"); %&gt; &lt;%= $variable; # This is a shortcut for "&lt;%echo .." %&gt; </programlisting> </example> </para> <para> 첫번째 방법은 short tags가 enable되어 있어야 사용가능하다. PHP config file (php.ini)의 <link linkend="ini.short-open-tag">short_open_tag</link>을 설정을 해 주거나, 컴파일시에 <command>configure</command> 스크립트의 옵션으로 --enable-short-tags을 주어 설정할 수 있다. </para> <para> 두번째 방법은 일반적으로 가장 선호되는 방법이다. 이 방법은 차세대 언어인 XHTML에서도 사용가능하다. </para> <para> 네번째 방법은 ASP-style tags가 enable되어 있어야 사용가능하다. PHP config file (php.ini)의 <link linkend="ini.asp-tags">asp_tags</link>을 통해 설정한다. <note> <para>ASP-style tags는 3.0.4부터 지원된다.</para> </note> </para> <para> 닫는 괄호는 newline을 포함한다. </para> </sect1> <sect1 id="language.basic-syntax.instruction-separation"> <title>명령 구분 기호(Instruction separation)</title> <simpara> 각각의 명령은 C나 Perl과 같은 기호를 사용하여 구분한다. 즉, 한 문장은 ;(세미콜론)으로 종료한다. </simpara> <para> PHP의 종료택인 ?&gt;는 문장의 끝이라는 의미도 함께 가지고 있다. 따라서 다음 두 개의 문장은 동일하다.: <informalexample> <programlisting> &lt;?php echo "This is a test"; ?> &lt;?php echo "This is a test" ?> </programlisting> </informalexample> </para> </sect1> <sect1 id="language.basic-syntax.comments"> <title>주석문 (Comments)</title> <para> PHP는 'C'와 'C++', Unix shell 형태의 주석문을 모두 제공한다. 예를 들어 : <informalexample> <programlisting> &lt;?php echo "This is a test"; // This is a one-line c++ style comment /* This is a multi line comment yet another line of comment */ echo "This is yet another test"; echo "One Final Test"; # This is shell-style style comment ?> </programlisting> </informalexample> </para> <simpara> 한줄짜리 주석문은 라인의 끝이나, 해당 php 코드 블록의 끝에서 끝난다. </simpara> <informalexample> <programlisting> &lt;h1>This is an &lt;?php # echo "simple";?> example.&lt;/h1> &lt;p>The header above will say 'This is an example'. </programlisting> </informalexample> <simpara> 'C' 형태의 주석문은 중복해서 사용하지 않도록 주의하자. </simpara> <informalexample> <programlisting> &lt;?php /* echo "This is a test"; /* This comment will cause a problem */ */ ?> </programlisting> </informalexample> </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: -->

« previous php.doc (#969333496) next »