cvs: phpdoc-kr /faq build.xml databases.xml html.xml /reference/mysql/functions mysql-fetch-object.xml /reference/outcontrol/functions
ob-get-status.xml /reference/strings/functions fprintf.xml htmlentities.xml htmlspecialchars.xml

From: Date: Wed, 19 Nov 2008 08:25:15 +0000
Subject: cvs: phpdoc-kr /faq build.xml databases.xml html.xml /reference/mysql/functions mysql-fetch-object.xml /reference/outcontrol/functions
ob-get-status.xml /reference/strings/functions fprintf.xml htmlentities.xml htmlspecialchars.xml
Groups: php.doc.kr 
Request: Send a blank email to doc-kr+get-780@lists.php.net to get a copy of this message
progcom Wed Nov 19 08:25:15 2008 UTC Modified files: /phpdoc-kr/faq build.xml databases.xml html.xml /phpdoc-kr/reference/mysql/functions mysql-fetch-object.xml /phpdoc-kr/reference/outcontrol/functions ob-get-status.xml /phpdoc-kr/reference/strings/functions fprintf.xml htmlentities.xml htmlspecialchars.xml Log: sync

http://cvs.php.net/viewvc.cgi/phpdoc-kr/faq/build.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc-kr/faq/build.xml diff -u phpdoc-kr/faq/build.xml:1.7 phpdoc-kr/faq/build.xml:1.8 --- phpdoc-kr/faq/build.xml:1.7 Mon Jun 25 10:30:43 2007 +++ phpdoc-kr/faq/build.xml Wed Nov 19 08:25:15 2008 @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.26 Maintainer: fuzzy74 Status: ready --> +<!-- EN-Revision: 1.34 Maintainer: progcom Status: ready --> +<!-- CREDITS: fuzzy74 --> <chapter xml:id="faq.build" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> - <title>빌드(build)시의 문제</title> + <title>빌드 시 문제</title> <titleabbrev>빌드 시 발생할수 있는 문제</titleabbrev> <para> @@ -256,7 +256,7 @@ <qandaentry xml:id="faq.build.not-running"> <question> <para> - Unix상에서 아파치 모듈을 인스톨하기 위한 모든 단계를 따라했습니다. + 유닉스에서 아파치 모듈을 인스톨하기 위한 모든 단계를 따라했습니다. 그리고 브라우저에서 PHP 스크립트를 보려고하면 저장하겠냐고 묻습니다. </para> </question> @@ -280,10 +280,7 @@ <simpara> <literal>아파치의 .conf</literal>파일에 다음과 같은 Mime 타입 설정을 추가했는지 확인하세요. - <literal>AddType application/x-httpd-php3 .php3</literal> (for PHP 3) - </simpara> - <simpara> - 또는 <literal>AddType application/x-httpd-php .php</literal> (for PHP 4) + <literal>AddType application/x-httpd-php .php</literal> </simpara> <simpara> 그리고 &lt;Virtualhost&gt; 이나 &lt;Directory&gt; 블록안에 이 @@ -460,6 +457,17 @@ 아무 메시지도 보여주지 않게 되는것입니다. 또 명심할것은 MySQL 은 기본적으로(default) 지원이 된다는것입니다. </para> + <note> + <para> + PHP 4.3.2부터, 빌드(make)가 완료된 후 다음 텍스트를 보게 됩니다: + </para> + <para> + <screen> + Build complete. + (It is safe to ignore warnings about tempnam and tmpnam). + </screen> + </para> + </note> </answer> </qandaentry> http://cvs.php.net/viewvc.cgi/phpdoc-kr/faq/databases.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc-kr/faq/databases.xml diff -u phpdoc-kr/faq/databases.xml:1.5 phpdoc-kr/faq/databases.xml:1.6 --- phpdoc-kr/faq/databases.xml:1.5 Sat Jun 23 13:51:36 2007 +++ phpdoc-kr/faq/databases.xml Wed Nov 19 08:25:15 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.19 Maintainer: fuzzy74 Status: ready --> +<!-- EN-Revision: 1.33 Maintainer: progcom Status: ready --> +<!-- CREDITS: fuzzy74 --> <chapter xml:id="faq.databases" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>데이터베이스와 관련된 문제</title> <titleabbrev>데이터베이스와 관련된 문제</titleabbrev> @@ -47,9 +47,7 @@ 유닉스에서 PHP를 사용하고 있고 윈도우 박스의 MS 액세스와 연동하기를 원한다면 유닉스 ODBC 드라이버가 필요합니다. <link xlink:href="&url.openlink;">OpenLink Software</link>에 이를 수행할수 있는 - 유닉스 기반(Unix-based) ODBC 드라이버가 있습니다. 그곳에는 시험판(evalution)을 - 다운로드 할수 있는 안내용 프로그램(pilot program)이 있고, 그리고 675달러이상하는 - 상업용 버전도 있습니다. + 유닉스 기반 ODBC 드라이버가 있습니다. </para> <para> 다른 방법은 윈도우 ODBC 드라이버까지 포함되있고 데이터도 저장할수 있는 @@ -57,24 +55,27 @@ PHP로(내장 드라이버)로 접근할수 있습니다. 또는 액세스와 PHP 모두에게 가용한 파일 형식을 이용하는것입니다. 즉 일반 파일(flat files)이나 dBase 형식으로요. 이에 관련된 글을 OpenLink software의 Tim Hayes가 쓴글을 참고하세요: - <programlisting> - Using another database as an intermediary is not a good idea, when you can - use ODBC from PHP straight to your database - i.e. with OpenLink's drivers. If - you do need to use an intermediary file format, OpenLink have now released - Virtuoso (a virtual database engine) for NT, Linux and other unix platforms. - Please visit our <link xlink:href="&url.openlink;">website</link> for a free download. - </programlisting> + <blockquote> + <para> + PHP에서 직접 ODBC를 사용하여 데이터베이스에 접근 할 수 있을 경우 - 즉, + OpenLink의 드라이버를 사용할 경우 중간 단계로 다른 데이터베이스를 + 사용하는 것은 좋은 생각이 아닙니다. 중간 파일 형식을 사용해야 한다면, + OpenLink에서 Virtuoso(가상 데이터베이스 엔진)를 NT, 리눅스, 기타 + 유닉스 플랫폼에 릴리즈했습니다. <link xlink:href="&url.openlink;">웹 + 사이트</link>에서 무료로 내려받을 수 있습니다. + </para> + </blockquote> </para> <para> 다른 방법은 MySQL을 사용하고, 윈도우상에서 MyODBC드라이버를 사용하여 데이터베이스를 - 일치(synchronizing)시키는 것입니다. Steve Lawrence의 글을 참고하세요: + 동기화하는 것입니다. Steve Lawrence의 글을 참고하세요: </para> <para> <itemizedlist> <listitem> <simpara> - MySQL의 지시에 따라 사용중인 플래폼에 MySQL을 설치합니다. - <link xlink:href="&url.mysql;">www.mysql.com</link>(미러에서 받을수있슴!)에서 받을수 있습니다. + MySQL의 지시에 따라 사용중인 플랫폼에 MySQL을 설치합니다. + <link xlink:href="&url.mysql;">www.mysql.com</link>에서 받을수 있습니다. 데이터베이스를 설치할때 외에는 특별한 설정이 필요치않습니다. 계정을 설정하고, host 필드에는 %로 놓거나 MySQL을 접속하고자하는 윈도우 컴퓨터의 호스트명을 넣습니다. 서버명, 계정, 비밀번호를 넣습니다. @@ -83,7 +84,6 @@ <listitem> <simpara> MySQL사이트에서 윈도우드라이버용 MyODBC를 다운받습니다. - 최종버전은 dbc-2_50_19-win95.zip입니다(NT도 사용할수 있을뿐만아니라 소스도 있습니다) 윈도우 머신에 그것을 설치합니다. 이 프로그램에 포함되어있는 유틸로 동작을 테스트할수있습니다. </simpara> </listitem> @@ -96,9 +96,8 @@ </listitem> <listitem> <simpara> - 전체 설치(full install)로 액세스를 설치합니다. 이렇게 하면 적절한 추가항목(add-ins)도 - 같이 설치가 됩니다. 최소한 ODBC 지원과 링크드 테이블 매니저(linked table manager)가 - 필요합니다. + 전체 설치로 액세스를 설치해서, 필요한 애드인을 얻습니다... + 최소한 ODBC 지원과 연결 테이블 관리자가 필요합니다. </simpara> </listitem> <listitem> @@ -151,10 +150,10 @@ <qandaentry xml:id="faq.databases.mysql.php5"> <question> <para> - PHP 5 부터는 더이상 <link linkend="ref.mysql">MySQL</link> 클라이언트 + PHP 5 부터는 더이상 MySQL 클라이언트 라이브러리를 함께 제공하지 않는다고 하는데, 이말은 무슨 의미인가요? PHP로 계속 MySQL을 사용할수 있나요? MySQL을 사용하려고 하면 "function undefined"라는 - 에러 메시지를 보여줍니다. 뭣때문인지요? + 에러 메시지를 보여줍니다. 무엇때문인지요? </para> </question> <answer> @@ -163,65 +162,55 @@ 클라이언트 라이브러리 자체를 함께 제공하지 않는다는 것입니다. 그 이유는 특별한 순서없이 아래글에서 설명하도록 하겠습니다: </para> - <para> - 1. 요근래의 대부분의 시스템은 이미 클라이언트 라이브러리가 설치되어있습니다. - </para> - <para> - 2. 위에서 언급한대로, 라이브러리를 여러가지 버전을 갖게 되면 - 혼란스러워질수 있습니다. 예를 들면 어떤 버전은 mod_auth_mysql을 - 링크하고 다른 버전에는 PHP를 링크하고나서 아파치안에서 두개 버전을 - 모두 활성화시키면, 큰 충돌이 발생하게 됩니다. - 또한, 함께 제공된 라이브러리가 설치된 서버버전과 항상 잘 작동하지도 - 않습니다. 이런 경우를 잘 보여주는 예가 mysql.socket 유닉스 도메인 소켓 - 파일이 있는 곳을 찾을수 없을때입니다. - </para> - <para> - 3. 유지관리가 약간 더디게 되고 최신판 버전에 점점더 뒤떨어지게 될것입니다. - </para> - <para> - 4. 앞으로의 라이브러리 버전은 GPL을 따르고 따라서 우리가 BSD/아파치 스타일의 - 라이센스 프로젝트인 GPL의 라이브러리를 함께 제공할수 없기 때문에 - 업그레이드 경로를 갖을수 없습니다. PHP 5에서 이런 깨끗한 중단이 최고의 선택으로 - 보입니다. - </para> + <itemizedlist> + <listitem> + <para> + 요근래의 대부분의 시스템은 이미 클라이언트 라이브러리가 설치되어있습니다. + </para> + </listitem> + <listitem> + <para> + 위에서 언급한대로, 라이브러리를 여러가지 버전을 갖게 되면 + 혼란스러워질수 있습니다. 예를 들면 어떤 버전은 mod_auth_mysql을 + 링크하고 다른 버전에는 PHP를 링크하고나서 아파치안에서 두개 버전을 + 모두 활성화시키면, 큰 충돌이 발생하게 됩니다. + 또한, 함께 제공된 라이브러리가 설치된 서버버전과 항상 잘 작동하지도 + 않습니다. 이런 경우를 잘 보여주는 예가 mysql.socket 유닉스 도메인 소켓 + 파일이 있는 곳을 찾을수 없을때입니다. + </para> + </listitem> + <listitem> + <para> + 유지관리가 약간 더디게 되고 최신판 버전에 점점더 뒤떨어지게 될것입니다. + </para> + </listitem> + <listitem> + <para> + 앞으로의 라이브러리 버전은 GPL을 따르고 따라서 우리가 BSD/아파치 스타일의 + 라이센스 프로젝트인 GPL의 라이브러리를 함께 제공할수 없기 때문에 + 업그레이드 경로를 갖을수 없습니다. PHP 5에서 이런 깨끗한 중단이 최고의 선택으로 + 보입니다. + </para> + </listitem> + </itemizedlist> <para> 이와 같은 사실은 실제로 많은 사람들에게 영향이 있지는 않을것입니다. - 유닉스 유저, 최소한 그들이 무엇을 하는지 아는 유저,는 PHP를 빌드할때 단순히 - --with-mysql=/usr 을 추가시킴으로써 시스템의 libmysqlclient에 대한 PHP - 를 빌드하려 할것이기 때문입니다. 윈도우 유저는 &php.ini;안에 - <filename>php_mysql.dll</filename> 확장을 활성화시킬수 있습니다. - 또한 <filename>dll</filename> 디렉토리에 함께 제공된 다른 모든 DLL을 사용하듯이, - 적절한 <literal>%SYSTEMROOT%</literal> 디렉토리안에 - <filename>libmySQL.dll</filename>파일을 카피할수 있습니다. + 유닉스 사용자, 최소한 그들이 무엇을 하는지 아는 사용자는 PHP를 빌드할 때 + 항상 <option role="configure">--with-mysql=/usr</option> 옵션을 추가하여 + 시스템의 libmysqlclient 라이브러리로 PHP를 빌드했습니다. 윈도우 사용자는 + &php.ini;에서 <filename>php_mysql.dll</filename> 확장을 활성화할 수 + 있습니다. 자세한 설치 안내는 <link linkend="ref.mysql">MySQL + 레퍼런스</link>를 참고하십시오. 또한, + <filename>libmysql.dll</filename>이 시스템 PATH에 들어있는지 + 확인하십시오. 이를 하는 방법은 <link + linkend="faq.installation.addtopath">윈도우 시스템 PATH 설정하기</link> + FAQ를 읽어보십시오. <filename>libmysql.dll</filename>(과 많은 PHP 관련 + 파일들)은 PHP 폴더에 존재하므로, PHP 폴더를 시스템 PATH에 추가할 수 + 있습니다. </para> </answer> </qandaentry> - <qandaentry xml:id="faq.databases.upgraded"> - <question> - <para> - I upgraded to PHP 4, and now mysql keeps telling me - "Warning: MySQL: Unable to save result set in ...". What's up? - PHP 4로 업그레이드했습니다. 그런데 mysql이 다음과같은 메시지를 보여줍니다. - "Warning: MySQL: Unable to save result set in ...". 뭐죠? - </para> - </question> - <answer> - <para> - 대부분 PHP 4는 MySQL에대한 경로를 지정하지 않으면 - '--with-mysql' 옵션으로 컴파일됩니다. 이것은 PHP가 내장(built-in) MySQL 클라이언트 - 라이브러리(MySQL client library)를 사용한다는 것입니다. 시스템이 응용프로그램을 - 실행할때 아파치 모듈로서의 PHP3나 auth-mysql과 같이 다른 버전의 MySQL클라이언트를 - 사용하면, 다른 버전의 클라이언트 사이에는 충돌이 발생합니다. - </para> - <para> - PHP 4를 다시 컴파일하세요. 그리고 플래그값으로 MySQL경로를 넣으세요. - '<link linkend="mysql.configure">--with-mysql=/your/path/to/mysql</link>' - 보통 이렇게 하면 해결됩니다. - </para> - </answer> - </qandaentry> - <qandaentry xml:id="faq.databases.shared-mysql"> <question> <para> @@ -244,8 +233,8 @@ <question> <para> 왜 다음과 같은 에러가 발생합니까: - "Warning: 0 is not a MySQL result index in &lt;file&gt; - on line &lt;x&gt;" 또는 "Warning: Supplied argument is not + "Warning: 0 is not a MySQL result index in &lt;file&gt; + on line &lt;x&gt;" 또는 "Warning: Supplied argument is not a valid MySQL result resource in &lt;file&gt; on line &lt;x&gt;? </para> </question> @@ -256,16 +245,26 @@ 돌아온 결과 식별자를 사용하기 전에 에러를 점검할 필요가 있습니다. 다음과 비슷한 방법이면 됩니다. <programlisting role="php"> +<![CDATA[ +<?php + $result = mysql_query("SELECT * FROM tables_priv"); if (!$result) { echo mysql_error(); exit; } +?> +]]> </programlisting> - or + 또는 <programlisting role="php"> +<![CDATA[ +<?php + $result = mysql_query("SELECT * FROM tables_priv") - or die("Bad query: ".mysql_error()); + or die("Bad query: " . mysql_error()); +?> +]]> </programlisting> </para> </answer> http://cvs.php.net/viewvc.cgi/phpdoc-kr/faq/html.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-kr/faq/html.xml diff -u phpdoc-kr/faq/html.xml:1.3 phpdoc-kr/faq/html.xml:1.4 --- phpdoc-kr/faq/html.xml:1.3 Sat Jun 23 13:51:36 2007 +++ phpdoc-kr/faq/html.xml Wed Nov 19 08:25:15 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.21 Maintainer: fuzzy74 Status: ready --> +<!-- EN-Revision: 1.31 Maintainer: progcom Status: ready --> +<!-- CREDITS: fuzzy74 --> <chapter xml:id="faq.html" xmlns="http://docbook.org/ns/docbook"> <title>PHP와 HTML</title> <titleabbrev>PHP와 HTML</titleabbrev> @@ -8,8 +8,8 @@ <para> PHP와 HTML은 많은 연관성을 가지고 있습니다: PHP는 HTML을 생성할 수있고, HTML은 PHP로 정보를 넘겨줄수 있습니다. 이 faq를 읽기전에 - <link linkend="language.variables.external">PHP로 변수를 가져오는 방법</link>을 - 아는것이 필요합니다. 이 주제에 관한 매뉴얼 페이지는 많은 예제도 포함되있습니다. + <link linkend="language.variables.external">외부 변수</link>를 가져오는 + 방법을 알아야 합니다. 이 주제에 관한 매뉴얼 페이지는 많은 예제도 포함되있습니다. <literal>register_globals</literal>가 무슨 의미인지도 알아야 합니다. </para> @@ -48,7 +48,7 @@ <programlisting role="php"> <![CDATA[ <?php - echo "<input type=hidden value=\"" . htmlspecialchars($data) . "\">\n"; + echo "<input type='hidden' value='" . htmlspecialchars($data) . "' />\n"; ?> ]]> </programlisting> @@ -68,7 +68,7 @@ <programlisting role="php"> <![CDATA[ <?php - echo "<textarea name=mydata>\n"; + echo "<textarea name='mydata'>\n"; echo htmlspecialchars($data)."\n"; echo "</textarea>"; ?> @@ -87,12 +87,12 @@ </simpara> </note> <example> - <title>URL내에서</title> + <title>URL 안에서</title> <programlisting role="php"> <![CDATA[ <?php - echo "<a href=\"" . htmlspecialchars("/nextpage.php?stage=23&data=" . - urlencode($data)) . "\">\n"; + echo "<a href='" . htmlspecialchars("/nextpage.php?stage=23&data=" . + urlencode($data)) . "'>\n"; ?> ]]> </programlisting> @@ -137,7 +137,7 @@ 폼을 보낼때 표준 submit 버튼을 사용하는 대신에 image버튼을 사용할수 있습니다 <programlisting role="html"> <![CDATA[ -<input type="image" src="image.gif" name="foo"> +<input type="image" src="image.gif" name="foo" /> ]]> </programlisting> 유저가 image버튼을 클릭할때, 수행 폼은 추가적인 변수: @@ -148,9 +148,14 @@ 유효하지 않은 변수이기 때문에, 자동적으로 <varname>foo_x</varname>와 <varname>foo_y</varname>변수명으로 바뀝니다. 즉, 밑줄(underscore)로 변경이 됩니다. 그래서 - <link linkend="language.variables.external">PHP로 변수를 가져오는 방법</link>에서 + <link linkend="language.variables.external">외부 변수</link>에서 설명된것처럼 다른 방법으로 이 변수를 이용할수 있습니다. 예를 들면 <varname>$_GET['foo_x']</varname>과 같습니다. + <note> + <para> + 요청 변수 이름의 공백은 밑줄로 변환됩니다. + </para> + </note> </para> </answer> </qandaentry> @@ -161,21 +166,16 @@ </question> <answer> <para> - To get your &lt;form&gt; result sent as an - <link linkend="language.types.array">array</link> to your PHP script - you name the &lt;input&gt;, &lt;select&gt; or &lt;textarea&gt; - elements like this: - PHP스크립트에 <link linkend="language.types.array">배열</link>을 보내는 &lt;form&gt;을 만들려면 &lt;input&gt;, &lt;select&gt; 또는 &lt;textarea&gt; 엘리먼트를 다음처럼 이름을 붙여봅니다: <programlisting role="html"> <![CDATA[ -<input name="MyArray[]"> -<input name="MyArray[]"> -<input name="MyArray[]"> -<input name="MyArray[]"> +<input name="MyArray[]" /> +<input name="MyArray[]" /> +<input name="MyArray[]" /> +<input name="MyArray[]" /> ]]> </programlisting> 변수명의 다음에 대괄호가 있습니다. 그것이 이 변수를 배열로 만들어줍니다. @@ -183,20 +183,20 @@ 그룹화할수 있습니다: <programlisting role="html"> <![CDATA[ -<input name="MyArray[]"> -<input name="MyArray[]"> -<input name="MyOtherArray[]"> -<input name="MyOtherArray[]"> +<input name="MyArray[]" /> +<input name="MyArray[]" /> +<input name="MyOtherArray[]" /> +<input name="MyOtherArray[]" /> ]]> </programlisting> 이것은 두 배열을 만들어냅니다. MyArray와 MyOtherArray배열은 PHP 스크립트로 보내집니다. 또한 배열에 특정 키값을 지정할수 있습니다: <programlisting role="html"> <![CDATA[ -<input name="AnotherArray[]"> -<input name="AnotherArray[]"> -<input name="AnotherArray[email]"> -<input name="AnotherArray[phone]"> +<input name="AnotherArray[]" /> +<input name="AnotherArray[]" /> +<input name="AnotherArray[email]" /> +<input name="AnotherArray[phone]" /> ]]> </programlisting> AnotherArray배열은 0, 1의 키와 email과 phone키를 내포하게 됩니다. @@ -204,15 +204,15 @@ <para> <note> <para> - 배열의 키는 HTML에서는 추가적인 특성입니다. 키로 지정하지 않으면 - 배열은 폼에 보여지는 엘리먼트 순서값으로 채워집니다. 첫번째 예제에서는 - 0, 1, 2, 3이 키값이 됩니다. + 배열의 키는 HTML에서는 추가적인 특성입니다. 키로 지정하지 않으면 + 배열은 폼에 보여지는 엘리먼트 순서값으로 채워집니다. 첫번째 예제에서는 + 0, 1, 2, 3이 키값이 됩니다. </para> </note> </para> <para> <link linkend="ref.array">배열 함수</link> - <link linkend="language.variables.external">PHP로 변수를 가져오는 방법</link>를 참고하세요. + <link linkend="language.variables.external">외부 변수</link>를 참고하세요. </para> </answer> </qandaentry> @@ -220,25 +220,20 @@ <qandaentry xml:id="faq.html.select-multiple"> <question> <para> - How do I get all the results from a select multiple HTML tag? 다중 선택 (select multiple) HTML 태그에서 어떻게 모든값을 가져올수 있습니까? </para> </question> <answer> <para> - The select multiple tag in an HTML construct allows users to - select multiple items from a list. These items are then passed - to the action handler for the form. The problem is that they - are all passed with the same widget name. ie. - 다중 선택 (select multiple)태그는 리스트 중에서 여러 아이템을 - 선택할수있게 합니다. 이 아이템들은 폼의 액션 핸들러로 보내집니다. - 문제는 그들이 같은 위젯(widget)명으로 전달이 된다는 것입니다. + 다중 선택 태그는 리스트 중에서 여러 아이템을 + 선택할 수 있게 합니다. 이 아이템들은 폼의 액션 핸들러로 보내집니다. + 문제는 그들이 같은 위젯 이름으로 전달이 된다는 것입니다. 즉, <programlisting role="html"> <![CDATA[ -<select name="var" multiple> +<select name="var" multiple="yes"> ]]> </programlisting> - 선택된 각 옵션(option)값은 액션 핸들러에 다음처럼 도착합니다: + 선택된 각 옵션 값은 액션 핸들러에 다음처럼 도착합니다: <programlisting> var=option1 var=option2 @@ -249,7 +244,7 @@ 다음처럼 사용합니다. <programlisting role="html"> <![CDATA[ -<select name="var[]" multiple> +<select name="var[]" multiple="yes"> ]]> </programlisting> 이것은 PHP가 <varname>$var</varname>변수를 배열로 취급하고 배열의 @@ -291,7 +286,7 @@ 이것은 보통 클라이언트측에서만 가능한것입니다. </para> <para> - <programlisting> + <programlisting role="php"> <![CDATA[ <?php if (isset($_GET['width']) AND isset($_GET['height'])) { @@ -303,7 +298,7 @@ // (preserve the original query string // -- post variables will need to handled differently) - echo "<script language=\"javascript\">\n"; + echo "<script language='javascript'>\n"; echo " location.href=\"${_SERVER['SCRIPT_NAME']}?${_SERVER['QUERY_STRING']}" . "&width=\" + screen.width + \"&height=\" + screen.height;\n"; echo "</script>\n"; http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/mysql/functions/mysql-fetch-object.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc-kr/reference/mysql/functions/mysql-fetch-object.xml diff -u phpdoc-kr/reference/mysql/functions/mysql-fetch-object.xml:1.6 phpdoc-kr/reference/mysql/functions/mysql-fetch-object.xml:1.7 --- phpdoc-kr/reference/mysql/functions/mysql-fetch-object.xml:1.6 Sat Jun 23 13:51:40 2007 +++ phpdoc-kr/reference/mysql/functions/mysql-fetch-object.xml Wed Nov 19 08:25:15 2008 @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.14 Maintainer: pcraft Status: ok --> +<!-- EN-Revision: 1.18 Maintainer: progcom Status: ready --> +<!-- CREDITS: pcraft --> <refentry xml:id="function.mysql-fetch-object" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mysql_fetch_object</refname> @@ -11,6 +12,8 @@ <methodsynopsis> <type>object</type><methodname>mysql_fetch_object</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam> + <methodparam choice="opt"><type>array</type><parameter>params</parameter></methodparam> </methodsynopsis> <para> 인출된 행으로부터 속성을 가진 객체로 반환하고, @@ -23,6 +26,24 @@ <para> <variablelist> &mysql.result.description; + <varlistentry> + <term><parameter>class_name</parameter></term> + <listitem> + <para> + 생성할 클래스의 이름, 프로퍼티를 설정하고 반환합니다. + 지정하지 않으면, <classname>stdClass</classname> 객체를 반환합니다. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>params</parameter></term> + <listitem> + <para> + <parameter>class_name</parameter> 객체의 생성자에 넘길 인수들의 + 선택적인 <type>array</type>. + </para> + </listitem> + </varlistentry> </variablelist> </para> </refsect1> @@ -30,7 +51,8 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> -속성을 가진 <type>object</type>로 반환하거나, 더 이상의 행이 없을 때에는 &false;를 반환한다. + 문자열 프로퍼티를 가진 <type>object</type>를 반환하거나, 더 이상의 행이 + 없을 때에는 &false;를 반환한다. </para> <para> <function>mysql_fetch_row</function>는 지정된 result 지시자와 연관된 결과로부터 @@ -39,6 +61,30 @@ </para> </refsect1> + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>5.0.0</entry> + <entry> + 다른 객체로 반환할 수 있는 기능 추가 + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + <refsect1 role="examples"> &reftitle.examples; <para> @@ -66,14 +112,16 @@ <programlisting role="php"> <![CDATA[ <?php +class foo { + public $name; +} -$row = mysql_fetch_object($result); - -/* this is valid */ -echo $row->field; -/* this is invalid */ -// echo $row->0; +mysql_connect("hostname", "user", "password"); +mysql_select_db("mydb"); +$result = mysql_query("select name from mytable limit 1"); +$obj = mysql_fetch_object($result, 'foo'); +var_dump($obj); ?> ]]> </programlisting> http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/outcontrol/functions/ob-get-status.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc-kr/reference/outcontrol/functions/ob-get-status.xml diff -u phpdoc-kr/reference/outcontrol/functions/ob-get-status.xml:1.5 phpdoc-kr/reference/outcontrol/functions/ob-get-status.xml:1.6 --- phpdoc-kr/reference/outcontrol/functions/ob-get-status.xml:1.5 Mon Nov 10 20:51:23 2008 +++ phpdoc-kr/reference/outcontrol/functions/ob-get-status.xml Wed Nov 19 08:25:15 2008 @@ -10,9 +10,7 @@ &reftitle.description; <methodsynopsis> <type>array</type><methodname>ob_get_status</methodname> - <methodparam choice="opt"><type>bool</type> - <parameter>full_status</parameter> - <initializer>FALES</initializer></methodparam> + <methodparam choice="opt"><type>bool</type> <parameter>full_status</parameter> <initializer>FALSE</initializer></methodparam> </methodsynopsis> <para> <function>ob_set_status</function>는 최고 레벨 출력 버퍼의 상태 정보를 http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/strings/functions/fprintf.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-kr/reference/strings/functions/fprintf.xml diff -u phpdoc-kr/reference/strings/functions/fprintf.xml:1.3 phpdoc-kr/reference/strings/functions/fprintf.xml:1.4 --- phpdoc-kr/reference/strings/functions/fprintf.xml:1.3 Sun Nov 9 18:31:48 2008 +++ phpdoc-kr/reference/strings/functions/fprintf.xml Wed Nov 19 08:25:15 2008 @@ -1,150 +1,128 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.2 Maintainer: progcom Status: ready --> - <refentry xml:id="function.fprintf" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>fprintf</refname> - <refpurpose>문자열을 형식화하여 스트림에 기록합니다.</refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>int</type><methodname>fprintf</methodname> - <methodparam><type>resource</type><parameter>handle</parameter></methodparam> - <methodparam><type>string</type><parameter>format</parameter></methodparam> - <methodparam choice="opt"><type>mixed</type><parameter>args</parameter></methodparam> - </methodsynopsis> - <simpara> - 형식화 문자열 <parameter>format</parameter>에 따라 생성한 문자열을 - <parameter>handle</parameter>에 지정한 스트림 리소스에 기록합니다. - </simpara> - <simpara> - 포맷 문자열은 0개 이상의 지시어로 작성합니다: - 보통의 문자(<literal>%</literal>을 제외)는 결과에 직접 복사되고, - <emphasis>변환 특정어</emphasis>는 각각의 인수로 치환됩니다. 이는 - <function>fprintf</function>, <function>sprintf</function>, - <function>printf</function>에 적용됩니다. - </simpara> - <para> - 각각의 변환 특정어는 퍼센트 사인(<literal>%</literal>) 뒤에 한개 이상의 - 요소를 순서대로 가집니다: - <orderedlist> - <listitem> - <simpara> - 선택적인 <emphasis>패딩 지정어</emphasis>는 적합한 문자열 크기를 - 맞추기 위해 사용하는 문자를 결정합니다. 이는 스페이스 문자나 - <literal>0</literal>(제로 문자)일 수 있습니다. 기본값은 - 스페이스입니다. 다른 패딩 문자는 작은 따옴표(<literal>'</literal>)를 - 앞에 붙여서 지정할 수 있습니다. 아래의 예제를 참고하십시오. - </simpara> - </listitem> - <listitem> - <simpara> - 선택적인 <emphasis>정렬 지정어</emphasis>는 결과를 좌측 정렬할지, 우측 - 정렬할지를 결정합니다. 기본값은 우측 정렬입니다; <literal>-</literal> - 문자로 좌측 정렬로 변경합니다. - </simpara> - </listitem> - <listitem> - <simpara> - 선택적인 수 <emphasis>폭 지정어</emphasis>는 얼마나 많은 - 문자를 (최소한) 이 변환의 결과에 포함할지를 결정합니다. - </simpara> - </listitem> - <listitem> - <simpara> - 선택적인 <emphasis>정확도 지정어</emphasis>는 부동소수점 수에 소수점 - 아래에 몇자리까지 표시할지를 결정합니다. 이 옵션은 - <type>float</type>가 아닌 형에는 유효하지 않습니다. (수를 형식화하는 - 다른 좋은 함수로 <function>number_format</function>이 존재합니다.) - </simpara> - </listitem> - <listitem> - <para> - <emphasis>형 지정어</emphasis>는 인수의 데이터를 어떻게 취급할지 - 결정합니다. 가능한 형은: - <simplelist> - <member> - <literal>%</literal> - 단순한 퍼센트 문자. 인수는 필요하지 않습니다. - </member> - <member> - <literal>b</literal> - 인수를 정수형으로 취급하고, 이진수로 - 표현합니다. - </member> - <member> - <literal>c</literal> - 인수를 정수형으로 취급하고, ASCII 값에 - 해당하는 문자로 표현합니다. - </member> - <member> - <literal>d</literal> - 인수를 정수형으로 취급하고, (부호 있는) - 10진수로 표현합니다. - </member> - <member> - <literal>u</literal> - 인수를 정수형으로 취급하고, 부호 없는 - 10진수로 표현합니다. - </member> - <member> - <literal>f</literal> - 인수를 <type>float</type>로 취급하고, - 부동소수점 수로 표현합니다. - </member> - <member> - <literal>o</literal> - 인수를 정수형으로 취급하고, 8진수로 - 표현합니다. - </member> - <member> - <literal>s</literal> - 인수를 문자열로 취급/표현합니다. - </member> - <member> - <literal>x</literal> - 인수를 정수형으로 취급하고, (소문자를 - 사용하여) 16진수로 표현합니다. - </member> - <member> - <literal>X</literal> - 인수를 정수형으로 취급하고, (대문자를 - 사용하여) 16진수로 표현합니다. - </member> - </simplelist> - </para> - </listitem> - </orderedlist> - </para> - <simpara> - 참고: <function>printf</function>, - <function>sprintf</function>, - <function>sscanf</function>, <function>fscanf</function>, - <function>vsprintf</function>, - <function>number_format</function>. - </simpara> - </refsect1> - <refsect1> - <title>예제</title> - <para> - <example> - <title><function>sprintf</function>: 제로 패드 정수형</title> - <programlisting role="php"> +<!-- EN-Revision: 1.10 Maintainer: progcom Status: ready --> +<refentry xml:id="function.fprintf" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>fprintf</refname> + <refpurpose>형식화한 문자열을 스트림에 기록</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>int</type><methodname>fprintf</methodname> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> + <methodparam><type>string</type><parameter>format</parameter></methodparam> + <methodparam choice="opt"><type>mixed</type><parameter>args</parameter></methodparam> + <methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam> + </methodsynopsis> + <para> + 형식화 문자열 <parameter>format</parameter>에 따라 생성한 문자열을 + <parameter>handle</parameter>에 지정한 스트림 리소스에 기록합니다. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>handle</parameter></term> + <listitem> + &fs.file.pointer; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>format</parameter></term> + <listitem> + <para> + <parameter>format</parameter> 설명은 <function>sprintf</function>를 + 참고하십시오. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>args</parameter></term> + <listitem> + <para> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>...</parameter></term> + <listitem> + <para> + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + 쓰여진 문자열의 길이를 반환합니다. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>fprintf</function>: 0을 채운 정수</title> + <programlisting role="php"> <![CDATA[ <?php -$isodate = sprintf("%04d-%02d-%02d", $year, $month, $day); +if (!($fp = fopen('date.txt', 'w'))) { + return; +} + +fprintf($fp, "%04d-%02d-%02d", $year, $month, $day); +// date.txt에 형식화한 ISO 날짜를 기록합니다 ?> ]]> - </programlisting> - </example> - <example> - <title><function>sprintf</function>: 통화 형식화</title> - <programlisting role="php"> + </programlisting> + </example> + <example> + <title><function>fprintf</function>: 통화 형식화</title> + <programlisting role="php"> <![CDATA[ <?php +if (!($fp = fopen('currency.txt', 'w'))) { + return; +} + $money1 = 68.75; $money2 = 54.35; $money = $money1 + $money2; // echo $money 는 "123.1"를 출력합니다; -$formatted = sprintf("%01.2f", $money); -// echo $formatted 는 "123.10"를 출력합니다. +$len = fprintf($fp, "%01.2f", $money); +// currency.txt에 "123.10"을 씁니다 + +echo "wrote $len bytes to currency.txt"; +// fprintf의 반환값은 기록한 바이트를 확인할 때 사용합니다 ?> ]]> - </programlisting> - </example> - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>printf</function></member> + <member><function>sprintf</function></member> + <member><function>sscanf</function></member> + <member><function>fscanf</function></member> + <member><function>vsprintf</function></member> + <member><function>number_format</function></member> + </simplelist> + </para> + </refsect1> + +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/strings/functions/htmlentities.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc-kr/reference/strings/functions/htmlentities.xml diff -u phpdoc-kr/reference/strings/functions/htmlentities.xml:1.4 phpdoc-kr/reference/strings/functions/htmlentities.xml:1.5 --- phpdoc-kr/reference/strings/functions/htmlentities.xml:1.4 Sun Nov 9 18:31:48 2008 +++ phpdoc-kr/reference/strings/functions/htmlentities.xml Wed Nov 19 08:25:15 2008 @@ -1,74 +1,152 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.10 Maintainer: progcom Status: ready --> - <refentry xml:id="function.htmlentities" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>htmlentities</refname> - <refpurpose> - 해당하는 모든 문자를 HTML 엔티티로 변환합니다. - </refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>string</type><methodname>htmlentities</methodname> - <methodparam><type>string</type><parameter>string</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>quote_style</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam> - </methodsynopsis> - <para> - <function>htmlentities</function>는 HTML 문자 엔티티에 존재하는 모든 - 문자를 엔티티로 변환하는 점을 제외하면, - <function>htmlspecialchars</function>와 완전히 동일합니다. - </para> - <para> - <function>htmlspecialchars</function>와 같게, 두번째에 위치하는 선택적인 - <parameter>quote_style</parameter> 인수는 '작은 따옴표'와 "큰 따옴표"를 - 어떻게 처리할지 정의합니다. 아래의 세 상수 중 하나를 가질 수 있으며, - 기본값은 <constant>ENT_COMPAT</constant>입니다: - <table> - <title>사용할 수 있는 <parameter>quote_style</parameter> 상수</title> - <tgroup cols="2"> - <thead> - <row> - <entry>상수명</entry> - <entry>설명</entry> - </row> - </thead> - <tbody> - <row> - <entry><constant>ENT_COMPAT</constant></entry> - <entry>큰 따옴표만 변환합니다.</entry> - </row> - <row> - <entry><constant>ENT_QUOTES</constant></entry> - <entry>작은 따옴표와 큰 따옴표 둘 다 변환합니다.</entry> - </row> - <row> - <entry><constant>ENT_NOQUOTES</constant></entry> - <entry>작은 따옴표와 큰 따옴표 둘 다 변환하지 않습니다.</entry> - </row> - </tbody> - </tgroup> - </table> - </para> - <para> - 선택적인 <parameter>quote</parameter> 인수는 PHP 4.0.3부터 지원합니다. - </para> - <para> - <function>htmlspecialchars</function>와 같게, 세번째에 위치하는 선택적인 - <parameter>charset</parameter> 인수는 변환에 사용할 문자셋을 정의합니다. - 이 인수는 PHP 4.1.0부터 지원합니다. 현재 기본값은 ISO-8859-1 - 문자셋입니다. - </para> - &reference.strings.charsets; - <para> - 디코드(역변환)를 하려면 <function>html_entity_decode</function>을 사용할 - 수 있습니다. - </para> - <para> - <example> - <title><function>htmlentities</function> 예제</title> - <programlisting role="php"> +<!-- EN-Revision: 1.15 Maintainer: progcom Status: ready --> +<refentry xml:id="function.htmlentities" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>htmlentities</refname> + <refpurpose>해당하는 모든 문자를 HTML 엔티티로 변환</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>htmlentities</methodname> + <methodparam><type>string</type><parameter>string</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>quote_style</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>double_encode</parameter></methodparam> + </methodsynopsis> + <para> + <function>htmlentities</function>는 HTML 문자 엔티티에 존재하는 모든 + 문자를 엔티티로 변환하는 점을 제외하면, + <function>htmlspecialchars</function>와 완전히 동일합니다. + </para> + <para> + 디코드(역변환)하려면 <function>html_entity_decode</function>를 사용할 수 + 있습니다. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>string</parameter></term> + <listitem> + <para> + 입력 문자열. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>quote_style</parameter></term> + <listitem> + <para> + <function>htmlspecialchars</function>와 같게, 두번째에 위치하는 선택적인 + <parameter>quote_style</parameter> 인수는 '홑따옴표'와 "겹따옴표"를 + 어떻게 처리할지 정의합니다. 아래의 세 상수 중 하나를 가질 수 있으며, + 기본값은 <constant>ENT_COMPAT</constant>입니다: + <table> + <title>사용할 수 있는 <parameter>quote_style</parameter> 상수</title> + <tgroup cols="2"> + <thead> + <row> + <entry>상수명</entry> + <entry>설명</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>ENT_COMPAT</constant></entry> + <entry>겹따옴표만 변환합니다.</entry> + </row> + <row> + <entry><constant>ENT_QUOTES</constant></entry> + <entry>홑따옴표와 겹따옴표 모두 변환합니다.</entry> + </row> + <row> + <entry><constant>ENT_NOQUOTES</constant></entry> + <entry>홑따옴표와 겹따옴표 모두 변환하지 않습니다.</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>charset</parameter></term> + <listitem> + <para> + <function>htmlspecialchars</function>와 같게, 세번째에 위치하는 선택적인 + <parameter>charset</parameter> 인수는 변환에 사용할 문자셋을 정의합니다. + 현재 기본값은 ISO-8859-1 문자셋입니다. + </para> + &reference.strings.charsets; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>double_encode</parameter></term> + <listitem> + <para> + <parameter>double_encode</parameter>를 끄면, PHP는 이미 존재하는 html + 엔티티를 인코드하지 않습니다. 기본값으로는 모두 변환합니다. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + 인코드한 문자열을 반환합니다. + </para> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>5.2.3</entry> + <entry> + <parameter>double_encode</parameter> 인수 추가. + </entry> + </row> + <row> + <entry>4.1.0</entry> + <entry> + <parameter>charset</parameter> 인수 추가. + </entry> + </row> + <row> + <entry>4.0.3</entry> + <entry> + <parameter>quote_style</parameter> 인수 추가. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>htmlentities</function> 예제</title> + <programlisting role="php"> <![CDATA[ <?php $str = "A 'quote' is <b>bold</b>"; @@ -80,17 +158,25 @@ echo htmlentities($str, ENT_QUOTES); ?> ]]> - </programlisting> - </example> - </para> - <para> - 참고: <function>html_entity_decode</function>, - <function>get_html_translation_table</function>, - <function>htmlspecialchars</function>, <function>nl2br</function>, - <function>urlencode</function>. - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>html_entity_decode</function></member> + <member><function>get_html_translation_table</function></member> + <member><function>htmlspecialchars</function></member> + <member><function>nl2br</function></member> + <member><function>urlencode</function></member> + </simplelist> + </para> + </refsect1> + +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/strings/functions/htmlspecialchars.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc-kr/reference/strings/functions/htmlspecialchars.xml diff -u phpdoc-kr/reference/strings/functions/htmlspecialchars.xml:1.5 phpdoc-kr/reference/strings/functions/htmlspecialchars.xml:1.6 --- phpdoc-kr/reference/strings/functions/htmlspecialchars.xml:1.5 Sun Nov 9 18:31:48 2008 +++ phpdoc-kr/reference/strings/functions/htmlspecialchars.xml Wed Nov 19 08:25:15 2008 @@ -1,100 +1,193 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.7 Maintainer: progcom Status: ready --> +<!-- EN-Revision: 1.13 Maintainer: progcom Status: ready --> <!-- CREDITS: cycle98 --> - <refentry xml:id="function.htmlspecialchars" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>htmlspecialchars</refname> - <refpurpose> - 특수 문자를 HTML 엔터티로 변환합니다. - </refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>string</type><methodname>htmlspecialchars</methodname> - <methodparam><type>string</type><parameter>string</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>quote_style</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam> - </methodsynopsis> - <para> - 어떤 문자들은 HTML에서 특별한 정의를 가지기에, 그 의미를 보존하려면, HTML - 엔터티로 표현해야 합니다. 이 함수는 이러한 변환을 수행한 문자열을 - 반환합니다; 이 번역은 모든 웹 프로그래밍에서 매우 유용합니다. 모든 HTML - 문자 엔터티를 번역해야 한다면, 이 함수 대신 - <function>htmlentities</function>를 사용하십시오. - </para> - <simpara> - 이 함수로 게시판이나 방명록 등의 프로그램에서, HTML을 포함하는 사용자 - 입력 텍스트를 막을 수 있습니다. 선택적인 두번째 인수 - <parameter>quote_style</parameter>은 작은 따옴표와 큰 따옴표를 어떻게 - 처리할지 결정합니다. 기본 모드는 하위 호환 모드 - <constant>ENT_COMPAT</constant>로, 큰 따옴표만 변환합니다. - <constant>ENT_QUOTES</constant>를 지정하면 작은 따옴표와 큰 따옴표 둘 다 - 변환하고, <constant>ENT_NOQUOTES</constant>를 지정하면 작은 따옴표와 큰 - 따옴표 둘 다 변환하지 않습니다. - </simpara> - <para> - 다음 문자들을 변역합니다: - <itemizedlist> - <listitem> - <simpara> - '&amp;'(앰퍼샌드)는 '&amp;amp;'가 됩니다. - </simpara> - </listitem> - <listitem> - <simpara> - '&quot;'(큰 따옴표)는 ENT_NOQUOTES를 지정하지 않았을 때 '&amp;quot;'가 - 됩니다. - </simpara> - </listitem> - <listitem> - <simpara> - '&#039;'(작은 따옴표)는 ENT_QUOTES를 지정했을 때만 '&amp;#039;'가 - 됩니다. - </simpara> - </listitem> - <listitem> - <simpara> - '&lt;'(보다 작음)는 '&amp;lt;'가 됩니다. - </simpara> - </listitem> - <listitem> - <simpara> - '&gt;'(보다 큼)는 '&amp;gt;'가 됩니다. - </simpara> - </listitem> - </itemizedlist> - <example> - <title><function>htmlspecialchars</function> 예제</title> - <programlisting role="php"> +<refentry xml:id="function.htmlspecialchars" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + <refnamediv> + <refname>htmlspecialchars</refname> + <refpurpose>특수 문자를 HTML 엔터티로 변환</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>htmlspecialchars</methodname> + <methodparam><type>string</type><parameter>string</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>quote_style</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>double_encode</parameter></methodparam> + </methodsynopsis> + <para> + 어떤 문자들은 HTML에서 특별한 정의를 가지기에, 그 의미를 보존하려면, HTML + 엔터티로 표현해야 합니다. 이 함수는 이러한 변환을 수행한 문자열을 + 반환합니다; 이 번역은 모든 웹 프로그래밍에서 매우 유용합니다. 모든 HTML + 문자 엔터티를 번역해야 한다면, 이 함수 대신 + <function>htmlentities</function>를 사용하십시오. + </para> + <simpara> + 이 함수로 게시판이나 방명록 등의 프로그램에서, HTML을 포함하는 사용자 + 입력 텍스트를 막을 수 있습니다. + </simpara> + <para> + 변환이 일어나는 문자는: + <itemizedlist> + <listitem> + <simpara> + '&amp;'(앰퍼샌드)는 '&amp;amp;'가 됩니다 + </simpara> + </listitem> + <listitem> + <simpara> + '&quot;'(겹따옴표)는 <constant>ENT_NOQUOTES</constant>를 설정하지 않았을 + 때 '&amp;quot;'가 됩니다. + </simpara> + </listitem> + <listitem> + <simpara> + '&#039;'(홑따옴표)는 <constant>ENT_QUOTES</constant>가 설정되었을 때만 + '&amp;#039;'가 됩니다. + </simpara> + </listitem> + <listitem> + <simpara> + '&lt;'(미만)은 '&amp;lt;'가 됩니다. + </simpara> + </listitem> + <listitem> + <simpara> + '&gt;'(이상)은 '&amp;gt;'가 됩니다. + </simpara> + </listitem> + </itemizedlist> + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>string</parameter></term> + <listitem> + <para> + 변환할 <type>string</type>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>quote_style</parameter></term> + <listitem> + <para> + 선택적인 두번째 인수 + <parameter>quote_style</parameter>은 홑따옴표와 겹따옴표를 어떻게 + 처리할지 결정합니다. 기본 모드는 하위 호환 모드 + <constant>ENT_COMPAT</constant>로, 겹따옴표만 변환합니다. + <constant>ENT_QUOTES</constant>를 지정하면 홑따옴표와 겹따옴표 둘 다 + 변환하고, <constant>ENT_NOQUOTES</constant>를 지정하면 홑따옴표와 큰 + 따옴표 둘 다 변환하지 않습니다. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>charset</parameter></term> + <listitem> + <para> + 변환에 사용할 문자셋을 정의합니다. 기본 문자셋은 ISO-8859-1입니다. + </para> + &reference.strings.charsets; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>double_encode</parameter></term> + <listitem> + <para> + <parameter>double_encode</parameter>를 끄면 PHP는 이미 존재하는 html + 엔티티를 인코드하지 않습니다. 기본값은 모두 변환합니다. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + 변환된 <type>string</type>. + </para> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>5.2.3</entry> + <entry> + <parameter>double_encode</parameter> 인수 추가. + </entry> + </row> + <row> + <entry>4.1.0</entry> + <entry> + <parameter>charset</parameter> 인수 추가. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>htmlspecialchars</function> 예제</title> + <programlisting role="php"> <![CDATA[ <?php $new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES); echo $new; // &lt;a href=&#039;test&#039;&gt;TEST&lt;/a&gt; ?> ]]> - </programlisting> - </example> - </para> - <para> - 이 함수는 위 목록 이외에는 아무 것도 번역하지 않는 점에 주의하십시오. - 완전한 엔터티 번역을 위해서는, <function>htmlentities</function>를 - 참고하십시오. 선택적인 두번째 인수는 PHP 3.0.17과 PHP 4.0.3에서 - 추가되었습니다. - </para> - <para> - 선택적인 세번째 인수 <parameter>charset</parameter>은 변환에 사용하는 - 문자셋을 정의합니다. 기본 문자셋은 ISO-8859-1입니다. 세번째 인수는 PHP - 4.1.0부터 지원합니다. - </para> - &reference.strings.charsets; - <para> - 참고: <function>get_html_translation_table</function>, - <function>strip_tags</function>, - <function>htmlentities</function>, <function>nl2br</function>. - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + 이 함수는 위 목록 이외에는 아무 것도 번역하지 않는 점에 주의하십시오. + 완전한 엔터티 번역을 위해서는, <function>htmlentities</function>를 + 참고하십시오. + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>get_html_translation_table</function></member> + <member><function>htmlspecialchars_decode</function></member> + <member><function>strip_tags</function></member> + <member><function>htmlentities</function></member> + <member><function>nl2br</function></member> + </simplelist> + </para> + </refsect1> + +</refentry> <!-- Keep this comment at the end of the file Local variables:
« previous php.doc.kr (#780) next »