cvs: phpdoc-kr / language-snippets.ent /chapters intro.xml /faq obtaining.xml /install intro.xml pecl.xml /install/windows index.xml
/reference/filesystem ini.xml /reference/iconv configure.xml /reference/math/functions rand.xml /reference/mysql/functions mysql-connect.xml
/reference/pcre/functions preg-match-all.xml preg-match.xml /reference/strings charsets.xml /reference/strings/functions quotemeta.xml sprintf.xml
str-repeat.xml str-replace.xml strcspn.xml stripslashes.xml stristr.xml /reference/zlib configure.xml

From: Date: Thu, 13 Nov 2008 15:40:54 +0000
Subject: cvs: phpdoc-kr / language-snippets.ent /chapters intro.xml /faq obtaining.xml /install intro.xml pecl.xml /install/windows index.xml
/reference/filesystem ini.xml /reference/iconv configure.xml /reference/math/functions rand.xml /reference/mysql/functions mysql-connect.xml
/reference/pcre/functions preg-match-all.xml preg-match.xml /reference/strings charsets.xml /reference/strings/functions quotemeta.xml sprintf.xml
str-repeat.xml str-replace.xml strcspn.xml stripslashes.xml stristr.xml /reference/zlib configure.xml
Groups: php.doc.kr 
Request: Send a blank email to doc-kr+get-772@lists.php.net to get a copy of this message
progcom Thu Nov 13 15:40:54 2008 UTC Modified files: /phpdoc-kr language-snippets.ent /phpdoc-kr/chapters intro.xml /phpdoc-kr/faq obtaining.xml /phpdoc-kr/install intro.xml pecl.xml /phpdoc-kr/install/windows index.xml /phpdoc-kr/reference/filesystem ini.xml /phpdoc-kr/reference/iconv configure.xml /phpdoc-kr/reference/math/functions rand.xml /phpdoc-kr/reference/mysql/functions mysql-connect.xml /phpdoc-kr/reference/pcre/functions preg-match-all.xml preg-match.xml /phpdoc-kr/reference/strings charsets.xml /phpdoc-kr/reference/strings/functions quotemeta.xml sprintf.xml str-repeat.xml str-replace.xml strcspn.xml stripslashes.xml stristr.xml /phpdoc-kr/reference/zlib configure.xml Log: sync

http://cvs.php.net/viewvc.cgi/phpdoc-kr/language-snippets.ent?r1=1.63&r2=1.64&diff_format=u Index: phpdoc-kr/language-snippets.ent diff -u phpdoc-kr/language-snippets.ent:1.63 phpdoc-kr/language-snippets.ent:1.64 --- phpdoc-kr/language-snippets.ent:1.63 Wed Nov 12 22:05:47 2008 +++ phpdoc-kr/language-snippets.ent Thu Nov 13 15:40:52 2008 @@ -147,7 +147,7 @@ <function>stripslashes</function>를 사용할 수 있습니다.</para></note>'> <!ENTITY warn.no-win32-fopen-wrapper '<warning><para>PHP 4.3.0 이전의 -Windows 버전 PHP에서는 이 함수를 이용하여 원격 파일에 +윈도우 버전 PHP에서는 이 함수를 이용하여 원격 파일에 접근할 수 없습니다. <link linkend="ini.allow-url-fopen">allow_url_fopen</link>을 활성화하여도 마찬가지입니다. </para></warning>'> http://cvs.php.net/viewvc.cgi/phpdoc-kr/chapters/intro.xml?r1=1.15&r2=1.16&diff_format=u Index: phpdoc-kr/chapters/intro.xml diff -u phpdoc-kr/chapters/intro.xml:1.15 phpdoc-kr/chapters/intro.xml:1.16 --- phpdoc-kr/chapters/intro.xml:1.15 Sun Nov 9 07:37:43 2008 +++ phpdoc-kr/chapters/intro.xml Thu Nov 13 15:40:53 2008 @@ -92,7 +92,7 @@ 커맨드 라인 스크립팅. 어떠한 서버나 브라우저 없이 PHP 스크립트를 실행하게 할 수 있습니다. 이 때에는 PHP 파서만 있으면 됩니다. 이런 사용법은 스크립트를 cron(*nix나 Linux에서)이나 작업 - 관리자(Windows에서)를 사용해 실행하는 것과 동일합니다. 이런 스크립트들은 + 관리자(윈도우에서)를 사용해 실행하는 것과 동일합니다. 이런 스크립트들은 간단한 텍스트 처리 작업에 사용될 수도 있습니다. 더 많은 정보를 위해서는 <link linkend="features.commandline">PHP의 커맨드 라인 사용법</link> 섹션을 참고하십시오. @@ -114,7 +114,7 @@ </para> <para> PHP는 리눅스, 많은 유닉스 계열 (HP-UX, Solaris와 OpenBSD를 포함), - Microsoft Windows, 맥 OS X, RISC OS 등과 같은 모든 유명한 OS에서 사용할 + 마이크로소프트 윈도우, 맥 OS X, RISC OS 등과 같은 모든 유명한 OS에서 사용할 수 있습니다. 또한, PHP는 오늘날의 대부분의 웹 서버를 지원합니다. 이것에는 아파치, Microsoft Internet Information Server, Personal Web Server, Netscape and iPlanet servers, Oreilly, Website Pro server, Caudium, Xitami, @@ -174,7 +174,7 @@ 이 세계 표준을 지원하는 어떤 데이터베이스라도 연결할 수 있습니다. </para> <para> - 또한 PHP는 LDAP, IMAP, SNMP, NNTP, POP3, HTTP, COM (Windows에서), + 또한 PHP는 LDAP, IMAP, SNMP, NNTP, POP3, HTTP, COM (윈도우에서), 그리고 셀 수 없는 여러가지 프로토콜들을 이용해서 다른 서비스와 연계할 수 있도록 지원합니다. 또한 비어있는 네트워크 소켓을 열수도 있기에 어떤 프로토콜과도 연계해서 실행할 수 있습니다. PHP는 WDDX complex data http://cvs.php.net/viewvc.cgi/phpdoc-kr/faq/obtaining.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc-kr/faq/obtaining.xml diff -u phpdoc-kr/faq/obtaining.xml:1.4 phpdoc-kr/faq/obtaining.xml:1.5 --- phpdoc-kr/faq/obtaining.xml:1.4 Sat Jun 23 13:51:36 2007 +++ phpdoc-kr/faq/obtaining.xml Thu Nov 13 15:40:53 2008 @@ -195,8 +195,8 @@ <para> 우선 Microsoft Visual C++ v6 (v5도 가능하지만 우리는 v6를 사용한다) 가 필요합니다. 그리고 다른 지원 파일이 필요합니다. - <link linkend="install.windows.building">building PHP from - source on Windows</link>에 관한 섹션을 참고하시기 바랍니다. + <link linkend="install.windows.building">윈도우에서 PHP 소스로 + 빌드하기</link>에 관한 섹션을 참고하시기 바랍니다. </para> </answer> </qandaentry> http://cvs.php.net/viewvc.cgi/phpdoc-kr/install/intro.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-kr/install/intro.xml diff -u phpdoc-kr/install/intro.xml:1.3 phpdoc-kr/install/intro.xml:1.4 --- phpdoc-kr/install/intro.xml:1.3 Sun Nov 9 18:31:46 2008 +++ phpdoc-kr/install/intro.xml Thu Nov 13 15:40:53 2008 @@ -44,11 +44,11 @@ PHP-GTK 는 공식적인 PHP 배포판에는 포함되지 않습니다. </para> <para> - 지금부터, 이 섹션은 Unix나 Windows상의 웹서버에 PHP를 서버 모듈 인터페이스와 CGI 실행방식으로 설치하는 방법을 다룰것입니다. + 지금부터, 이 섹션은 유닉스나 윈도우상의 웹서버에 PHP를 서버 모듈 인터페이스와 CGI 실행방식으로 설치하는 방법을 다룰것입니다. 또한 다음 섹션에서 커맨드 라인 실행방식에 대한 정보도 찾을 수 있을 것입니다. </para> <para> - PHP 소스코드와 Windows 바이너리 배포판들은 + PHP 소스코드와 윈도우 바이너리 배포판들은 <link xlink:href="&url.php.downloads;">&url.php.downloads;</link> 에서 찾을 수 있습니다. 배포판을 다운로드 하기 위해서 가까운 <link xlink:href="&url.mirrors;">mirror</link> 사이트를 사용할 것을 권장합니다. http://cvs.php.net/viewvc.cgi/phpdoc-kr/install/pecl.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-kr/install/pecl.xml diff -u phpdoc-kr/install/pecl.xml:1.3 phpdoc-kr/install/pecl.xml:1.4 --- phpdoc-kr/install/pecl.xml:1.3 Mon Jul 21 08:22:14 2008 +++ phpdoc-kr/install/pecl.xml Thu Nov 13 15:40:53 2008 @@ -78,12 +78,12 @@ 윈도우용 다운로드 </simpara> <simpara> - 윈도우즈 사용자들은 컴파일된 PECL 바이너리를 + 윈도우 사용자들은 컴파일된 PECL 바이너리를 <link xlink:href="&url.php.downloads;">PHP 다운로드</link> 페이지에 있는 <emphasis>PECL 확장모듈 모음</emphasis> 에서 다운로드 받을 수 있습니다. 또는 <link xlink:href="&url.php.snapshots;">PECL 스냅샷</link> 을 가져오거나, <link xlink:href="&url.pecl.win;">PECL4WIN</link> 에서 확장모듈 DLL을 구할수 있습니다. - 윈도우즈에서 PHP를 컴파일하기 위해서는 <link linkend="install.windows.building">절충 장</link> 을 읽어 보십시오. + 윈도우에서 PHP를 컴파일하기 위해서는 <link linkend="install.windows.building">절충 장</link> 을 읽어 보십시오. </simpara> </listitem> </itemizedlist> http://cvs.php.net/viewvc.cgi/phpdoc-kr/install/windows/index.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-kr/install/windows/index.xml diff -u phpdoc-kr/install/windows/index.xml:1.3 phpdoc-kr/install/windows/index.xml:1.4 --- phpdoc-kr/install/windows/index.xml:1.3 Mon Jul 21 08:22:14 2008 +++ phpdoc-kr/install/windows/index.xml Thu Nov 13 15:40:53 2008 @@ -1,14 +1,25 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.18 Maintainer: acidd15 Status: ? --> +<!-- EN-Revision: 1.21 Maintainer: progcom Status: ready --> +<!-- CREDITS: acidd15 --> <chapter xml:id="install.windows" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> - <title>윈도우즈 시스템에 인스톨하기</title> + <title>윈도우 시스템에 인스톨하기</title> <para> - 본 섹션은 Windows 98/Me 와 Windows NT/2000/XP/2003 에 해당 됩니다. - PHP는 Windows 3.1 같은 16비트 플랫폼상에서는 동작하지 않고 때때로 지원되는 윈도우즈 플랫폼이 Win32에 의존합니다. - Windows 95는 PHP 4.3.0 과 같은것은 더이상 지원되지 않습니다. + 본 섹션은 윈도우 98/Me와 윈도우 NT/2000/XP/2003에 해당합니다. + PHP는 윈도우 3.1 같은 16비트 플랫폼상에서는 동작하지 않고 때때로 지원되는 윈도우 플랫폼이 Win32에 의존합니다. + 윈도우 95는 PHP 4.3.0과 같은것은 더이상 지원되지 않습니다. </para> + <note> + <para> + PHP 5.3.0부터 윈도우 98/ME/NT4를 지원하지 않습니다. + </para> + </note> + <note> + <para> + PHP 4.3.0부터 윈도우 95를 지원하지 않습니다. + </para> + </note> <para> - 윈도우즈에 PHP를 인스톨하는데에는 크게 두가지 방법이 있습니다. + 윈도우에 PHP를 인스톨하는데에는 크게 두가지 방법이 있습니다. <link linkend="install.windows.manual">수동설치</link> 를 하거나 <link linkend="install.windows.installer">설치관리자</link> 를 사용하는 것입니다. </para> http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/filesystem/ini.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc-kr/reference/filesystem/ini.xml diff -u phpdoc-kr/reference/filesystem/ini.xml:1.7 phpdoc-kr/reference/filesystem/ini.xml:1.8 --- phpdoc-kr/reference/filesystem/ini.xml:1.7 Mon Nov 10 07:09:24 2008 +++ phpdoc-kr/reference/filesystem/ini.xml Thu Nov 13 15:40:53 2008 @@ -91,7 +91,7 @@ </note> <warning> <para> - 윈도우즈 버전 PHP 4.3.0 이전에는, 다음 함수는 원격 파일 접근을 + 윈도우 버전 PHP 4.3.0 이전에는, 다음 함수는 원격 파일 접근을 허용하지 않습니다: <function>include</function>, <function>include_once</function>, <function>require</function>, <function>require_once</function>, 그리고 <xref linkend="ref.image"/> http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/iconv/configure.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc-kr/reference/iconv/configure.xml diff -u phpdoc-kr/reference/iconv/configure.xml:1.5 phpdoc-kr/reference/iconv/configure.xml:1.6 --- phpdoc-kr/reference/iconv/configure.xml:1.5 Sat Nov 8 11:54:13 2008 +++ phpdoc-kr/reference/iconv/configure.xml Thu Nov 13 15:40:53 2008 @@ -8,12 +8,12 @@ <application>PHP</application> 바이너리를 빌드해야 합니다. </para> <note> - <title>Windows&reg; 사용자 주의</title> + <title>윈도우&reg; 사용자 주의</title> <simpara> - Windows&reg; 환경에서 이 모듈을 사용하려면, PHP/Win32 바이너리 패키지에 + 윈도우&reg; 환경에서 이 모듈을 사용하려면, PHP/Win32 바이너리 패키지에 들어 있는 <emphasis>iconv.dll</emphasis>, 또는 <emphasis>iconv-1.3.dll</emphasis>(4.2.1 이전) DLL 파일을 - <literal>PATH</literal> 환경 변수로 지정한 디렉토리나 Windows&reg;의 시스템 + <literal>PATH</literal> 환경 변수로 지정한 디렉토리나 윈도우&reg;의 시스템 디렉토리에 놓아야 합니다. </simpara> <simpara> http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/math/functions/rand.xml?r1=1.10&r2=1.11&diff_format=u Index: phpdoc-kr/reference/math/functions/rand.xml diff -u phpdoc-kr/reference/math/functions/rand.xml:1.10 phpdoc-kr/reference/math/functions/rand.xml:1.11 --- phpdoc-kr/reference/math/functions/rand.xml:1.10 Mon Nov 10 07:09:24 2008 +++ phpdoc-kr/reference/math/functions/rand.xml Thu Nov 13 15:40:53 2008 @@ -45,7 +45,7 @@ <note> <simpara> - 몇몇 플래폼(Windows 등)에서는 <constant>RAND_MAX</constant>는 + 몇몇 플랫폼(윈도우 등)에서는 <constant>RAND_MAX</constant>는 32768까지 입니다. 32768보다 큰 범위가 필요할 경우에는, <parameter>min</parameter>과 <parameter>max</parameter>를 지정하여 RAND_MAX보다 큰 범위를 만들거나, <function>mt_rand</function>을 http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/mysql/functions/mysql-connect.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc-kr/reference/mysql/functions/mysql-connect.xml diff -u phpdoc-kr/reference/mysql/functions/mysql-connect.xml:1.8 phpdoc-kr/reference/mysql/functions/mysql-connect.xml:1.9 --- phpdoc-kr/reference/mysql/functions/mysql-connect.xml:1.8 Sun Nov 9 18:31:47 2008 +++ phpdoc-kr/reference/mysql/functions/mysql-connect.xml Thu Nov 13 15:40:53 2008 @@ -229,7 +229,7 @@ <note> <para> 서버에서는 &quot;localhost&quot; 및 &quot;localhost:port&quot;를 사용할 때마다 -로컬 소켓(윈도우즈에서는 named pipe)으로 접속을 시도한다. +로컬 소켓(윈도우에서는 named pipe)으로 접속을 시도한다. TCP/IP를 이용하려면 &quot;localhost&quot; 대신 &quot;127.0.0.1&quot;를 사용하면 된다. MySQL 클라이언트 라이브러리가 로컬 소켓으로 잘못된 접속을 시도한다면, http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/pcre/functions/preg-match-all.xml?r1=1.11&r2=1.12&diff_format=u Index: phpdoc-kr/reference/pcre/functions/preg-match-all.xml diff -u phpdoc-kr/reference/pcre/functions/preg-match-all.xml:1.11 phpdoc-kr/reference/pcre/functions/preg-match-all.xml:1.12 --- phpdoc-kr/reference/pcre/functions/preg-match-all.xml:1.11 Mon Nov 10 07:09:24 2008 +++ phpdoc-kr/reference/pcre/functions/preg-match-all.xml Thu Nov 13 15:40:53 2008 @@ -1,156 +1,234 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.12 Maintainer: progcom Status: ready --> - <refentry xml:id="function.preg-match-all" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>preg_match_all</refname> - <refpurpose>전역 정규 표현식 매치를 수행합니다.</refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>int</type><methodname>preg_match_all</methodname> - <methodparam><type>string</type><parameter>pattern</parameter></methodparam> - <methodparam><type>string</type><parameter>subject</parameter></methodparam> - <methodparam><type>array</type><parameter>matches</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam> - </methodsynopsis> - <para> - <parameter>pattern</parameter>에 주어진 정규 표현식으로 - <parameter>subject</parameter>에서 모든 매치를 찾아내고, - <parameter>flags</parameter>에 지정한 방법에 따라서 - <parameter>matches</parameter>에 넣습니다. - </para> - <para> - 처음 매치가 발견된 후, 이후 검색은 마지막 매치의 끝에서부터 이루어집니다. - </para> - <para> - <parameter>flags</parameter>는 다음 플래그들을 조합할 수 있습니다 - (<constant>PREG_PATTERN_ORDER</constant>와 - <constant>PREG_SET_ORDER</constant>를 동시에 사용하지 마십시오): - <variablelist> - <varlistentry> - <term>PREG_PATTERN_ORDER</term> - <listitem> - <para> - $matches[0] 배열이 전체 패턴을 가지고, $matches[1] 배열부터 괄호 안의 - 서브 패턴을 가지도록 결과를 지정합니다. - </para> - <para> - <informalexample> - <programlisting role="php"> +<!-- EN-Revision: 1.26 Maintainer: progcom Status: ready --> +<refentry xml:id="function.preg-match-all" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>preg_match_all</refname> + <refpurpose>전역 정규 표현식 매치를 수행합니다</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>int</type><methodname>preg_match_all</methodname> + <methodparam><type>string</type><parameter>pattern</parameter></methodparam> + <methodparam><type>string</type><parameter>subject</parameter></methodparam> + <methodparam><type>array</type><parameter role="reference">matches</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam> + </methodsynopsis> + <para> + <parameter>pattern</parameter>에 주어진 정규 표현식으로 + <parameter>subject</parameter>에서 모든 매치를 찾아내고, + <parameter>flags</parameter>에 지정한 방법에 따라서 + <parameter>matches</parameter>에 넣습니다. + </para> + <para> + 처음 매치가 발견된 후, 이후 검색은 마지막 매치의 끝에서부터 이루어집니다. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>pattern</parameter></term> + <listitem> + <para> + 탐색할 문자열 패턴. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>subject</parameter></term> + <listitem> + <para> + 입력 문자열. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>matches</parameter></term> + <listitem> + <para> + 모든 매치의 배열. <parameter>flags</parameter>에 따라서는, 다차원 배열. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>flags</parameter></term> + <listitem> + <para> + 다음 플래그들을 조합할 수 있습니다 + (<constant>PREG_PATTERN_ORDER</constant>와 + <constant>PREG_SET_ORDER</constant>를 동시에 사용할 수 없습니다): + <variablelist> + <varlistentry> + <term><constant>PREG_PATTERN_ORDER</constant></term> + <listitem> + <para> + $matches[0] 배열이 전체 패턴을 가지고, $matches[1] 배열부터 괄호 안의 + 서브 패턴을 가지도록 결과를 지정합니다. + </para> + <para> + <informalexample> + <programlisting role="php"> <![CDATA[ <?php -preg_match_all("|<[^>]+>(.*)</[^>]+>|U", - "<b>example: </b><div align=left>this is a test</div>", +preg_match_all("|<[^>]+>(.*)</[^>]+>|U", + "<b>example: </b><div align=left>this is a test</div>", $out, PREG_PATTERN_ORDER); echo $out[0][0].", ".$out[0][1]."\n"; echo $out[1][0].", ".$out[1][1]."\n"; ?> ]]> - </programlisting> - <para> - 이 예제의 결과: - </para> - <screen role="html"> + </programlisting> + &example.outputs; + <screen role="html"> <![CDATA[ <b>example: </b>, <div align=left>this is a test</div> example: , this is a test ]]> - </screen> - <para> - $out[0]는 전체 패턴의 문자열 배열을 가지고, - $out[1]은 태그 안의 문자열 배열을 가집니다. + </screen> + <para> + $out[0]는 전체 패턴의 문자열 배열을 가지고, + $out[1]은 태그 안의 문자열 배열을 가집니다. + </para> + </informalexample> </para> - </informalexample> - </para> - </listitem> - </varlistentry> - <varlistentry> - <term>PREG_SET_ORDER</term> - <listitem> - <para> - $matchs[0]가 처음 매치의 배열을 가지도록 하고, $matches[1]가 - 두번째 매치의 배열을 가지도록 결과를 지정합니다. - <informalexample> - <programlisting role="php"> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>PREG_SET_ORDER</constant></term> + <listitem> + <para> + $matchs[0]가 처음 매치의 배열을 가지도록 하고, $matches[1]가 + 두번째 매치의 배열을 가지도록 결과를 지정합니다. + <informalexample> + <programlisting role="php"> <![CDATA[ <?php -preg_match_all("|<[^>]+>(.*)</[^>]+>|U", - "<b>example: </b><div align=left>this is a test</div>", +preg_match_all("|<[^>]+>(.*)</[^>]+>|U", + "<b>example: </b><div align=\"left\">this is a test</div>", $out, PREG_SET_ORDER); echo $out[0][0].", ".$out[0][1]."\n"; echo $out[1][0].", ".$out[1][1]."\n"; ?> ]]> - </programlisting> - <para> - 이 예제의 결과: - </para> - <screen role="html"> + </programlisting> + &example.outputs; + <screen role="html"> <![CDATA[ <b>example: </b>, example: <div align="left">this is a test</div>, this is a test ]]> - </screen> - </informalexample> - </para> - <para> - 이 경우에는, $matches[0]는 처음 매치의 집합으로, $matches[0][0]는 - 전체 패턴을 가지고, $matches[0][1]부터 처음 서브 패턴을 가지게 됩니다. - 동일하게, $matches[1]는 두번째 매치의 집합입니다. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term>PREG_OFFSET_CAPTURE</term> - <listitem> - <para> - 이 플래그를 넘기면, 발생한 모든 매치에 대한 문자열의 시작 위치를 - 함께 반환합니다. <literal>0</literal>에 매치한 문자열을, - <literal>1</literal>에 <parameter>subject</parameter>의 문자열 시작 - 위치를 가지는 배열을 원소로 하는 배열을 반환합니다. 이 플래그는 - <literal>PHP</literal> 4.3.0부터 사용할 수 있습니다. - </para> - </listitem> - </varlistentry> - </variablelist> - </para> - - <para> - 보통, 검색은 목표 문자열의 처음에서 시작합니다. 선택적인 인수 - <parameter>offset</parameter>으로 검색을 시작할 다른 위치를 지정할 수 - 있습니다. 이는 <function>preg_match</function>의 목표 문자열에 - <function>substr</function>($subject, $offset)을 넘기는 것과 동일합니다. - <parameter>offset</parameter> 인수는 <literal>PHP</literal> 4.3.3부터 - 사용할 수 있습니다. - </para> - - <para> - 플러그가 주어지지 않으면, <constant>PREG_PATTERN_ORDER</constant>가 - 지정됩니다. - </para> - <para> - 전체 패턴이 매치된 횟수(0이 될 수 있음)나, - 에러 발생시에 &false;를 반환합니다. - </para> - <para> - <example> - <title>어떤 텍스트로부터 모든 전화번호 가져오기</title> - <programlisting role="php"> + </screen> + </informalexample> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>PREG_OFFSET_CAPTURE</constant></term> + <listitem> + <para> + 이 플래그를 넘기면, 모든 발생한 매치와 함께 오프셋을 반환합니다. + 이는 배열에서 <parameter>matches</parameter>의 값을 변경하는 점에 + 주의하십시오. 배열의 모든 요소는 매치한 문자열을 + <literal>0</literal> 오프셋에 가지고, 문자열 오프셋을 + <literal>1</literal> 오프셋에 가지게 됩니다. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + <para> + 플래그가 주어지지 않으면, <constant>PREG_PATTERN_ORDER</constant>로 + 취급합니다. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>offset</parameter></term> + <listitem> + <para> + 일반적으로, 주제 문자열의 처음부터 탐색을 시작합니다. 선택적인 + <parameter>offset</parameter> 인수로 탐색을 시작할 다른 위치를 지정할 + 수 있습니다. (바이트 단위) + </para> + <note> + <para> + <parameter>offset</parameter>을 사용하는 것은 + <function>preg_match_all</function>의 주제 문자열로 + <literal>substr($subject, $offset)</literal>을 사용하는 것과는 + 다릅니다. <parameter>pattern</parameter>로 <emphasis>^</emphasis>, + <emphasis>$</emphasis>, <emphasis>(?&lt;=x)</emphasis> 등을 사용할 수 + 있기 때문입니다. <function>preg_match</function>에서 예제를 + 확인해 보십시오. + </para> + </note> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + 전체 패턴이 매치된 횟수(0이 될 수 있음)나, + 에러 발생시에 &false;를 반환합니다. + </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>4.3.3</entry> + <entry> + <parameter>offset</parameter> 인수 추가 + </entry> + </row> + <row> + <entry>4.3.0</entry> + <entry> + <constant>PREG_OFFSET_CAPTURE</constant> 플래그 추가 + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>어떤 텍스트로부터 모든 전화번호 가져오기</title> + <programlisting role="php"> <![CDATA[ <?php preg_match_all("/\(? (\d{3})? \)? (?(1) [\-\s] ) \d{3}-\d{4}/x", "Call 555-1212 or 1-800-555-1212", $phones); ?> ]]> - </programlisting> - </example> - </para> - <para> - <example> - <title>HTML 태그 찾기 (greedy)</title> - <programlisting role="php"> + </programlisting> + </example> + </para> + <para> + <example> + <title>HTML 태그 찾기 (greedy)</title> + <programlisting role="php"> <![CDATA[ <?php // \\2는 역참조의 예제입니다. 이는 PCRE가 정규표현식 자체의 @@ -160,19 +238,17 @@ preg_match_all("/(<([\w]+)[^>]*>)(.*)(<\/\\2>)/", $html, $matches); -for ($i=0; $i< count($matches[0]); $i++) { - echo "matched: " . $matches[0][$i] . "\n"; - echo "part 1: " . $matches[1][$i] . "\n"; - echo "part 2: " . $matches[3][$i] . "\n"; - echo "part 3: " . $matches[4][$i] . "\n\n"; +foreach ($matches as $val) { + echo "matched: " . $val[0] . "\n"; + echo "part 1: " . $val[1] . "\n"; + echo "part 2: " . $val[3] . "\n"; + echo "part 3: " . $val[4] . "\n\n"; } ?> ]]> - </programlisting> - <para> - 이 예제의 결과: - </para> - <screen role="html"> + </programlisting> + &example.outputs; + <screen role="html"> <![CDATA[ matched: <b>bold text</b> part 1: <b> @@ -184,16 +260,88 @@ part 2: click me part 3: </a> ]]> - </screen> - </example> - </para> - <simpara> - 참고: <function>preg_match</function>, - <function>preg_replace</function>, - <function>preg_split</function>. - </simpara> - </refsect1> - </refentry> + </screen> + </example> + </para> + <para> + <example> + <title>이름 있는 서브패턴 사용하기</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$str = <<<FOO +a: 1 +b: 2 +c: 3 +FOO; + +preg_match_all('/(?<name>\w+): (?<digit>\d+)/', $str, $matches); + +print_r($matches); + +?> +]]> + </programlisting> + &example.outputs; + <screen role="html"> +<![CDATA[ +Array +( + [0] => Array + ( + [0] => a: 1 + [1] => b: 2 + [2] => c: 3 + ) + + [name] => Array + ( + [0] => a + [1] => b + [2] => c + ) + + [1] => Array + ( + [0] => a + [1] => b + [2] => c + ) + + [digit] => Array + ( + [0] => 1 + [1] => 2 + [2] => 3 + ) + + [2] => Array + ( + [0] => 1 + [1] => 2 + [2] => 3 + ) + +) +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>preg_match</function></member> + <member><function>preg_replace</function></member> + <member><function>preg_split</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/pcre/functions/preg-match.xml?r1=1.11&r2=1.12&diff_format=u Index: phpdoc-kr/reference/pcre/functions/preg-match.xml diff -u phpdoc-kr/reference/pcre/functions/preg-match.xml:1.11 phpdoc-kr/reference/pcre/functions/preg-match.xml:1.12 --- phpdoc-kr/reference/pcre/functions/preg-match.xml:1.11 Mon Nov 10 07:09:24 2008 +++ phpdoc-kr/reference/pcre/functions/preg-match.xml Thu Nov 13 15:40:53 2008 @@ -1,78 +1,206 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.12 Maintainer: progcom Status: ready --> - <refentry xml:id="function.preg-match" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>preg_match</refname> - <refpurpose>정규표현식 매치를 수행합니다.</refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>int</type><methodname>preg_match</methodname> - <methodparam><type>string</type><parameter>pattern</parameter></methodparam> - <methodparam><type>string</type><parameter>subject</parameter></methodparam> - <methodparam choice="opt"><type>array</type><parameter>matches</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam> - </methodsynopsis> - <para> - <parameter>pattern</parameter>에 주어진 정규표현식을 - <parameter>subject</parameter>에서 찾습니다. - </para> - <para> - <parameter>matches</parameter>가 주어지면, 검색 결과를 채워넣습니다. - <varname>$matches[0]</varname>는 전체 패턴 텍스트가 들어가고, - <varname>$matches[1]</varname>부터 괄호로 둘러싸인 서브 패턴을 - 채워넣습니다. - </para> - <para> - <parameter>flags</parameter>는 다음과 같은 플래그를 사용할 수 있습니다: - <variablelist> - <varlistentry> - <term>PREG_OFFSET_CAPTURE</term> - <listitem> - <simpara> - 이 플래그를 넘기면, 모든 매치에 대한 문자열 시작 위치를 함께 - 반환합니다. 반환값을 <literal>0</literal>에 매치한 문자열을 가지고, - <literal>1</literal>에 문자열 시작 위치를 가지는 배열을 원소로 갖는 - 배열로 변경하는 점에 주의하십시오. 이 플래그는 <literal>PHP</literal> - 4.3.0부터 사용할 수 있습니다. - </simpara> - </listitem> - </varlistentry> - </variablelist> - <parameter>flags</parameter> 인수는 <literal>PHP</literal> 4.3.0부터 - 사용할 수 있습니다. - </para> - - <para> - 보통, 검색은 목표 문자열의 처음에서 시작합니다. 선택적인 인수 - <parameter>offset</parameter>으로 검색을 시작할 다른 위치를 지정할 수 - 있습니다. 이는 <function>preg_match</function>의 목표 문자열에 - <function>substr</function>($subject, $offset)을 넘기는 것과 동일합니다. - <parameter>offset</parameter> 인수는 <literal>PHP</literal> 4.3.3부터 - 사용할 수 있습니다. - </para> - <para> - <function>preg_match</function>는 <parameter>pattern</parameter>이 - 매치된 횟수를 반환합니다. 이는 0(매치 없음)이나 1입니다. - <function>preg_match</function>는 처음 매치 후에 검색을 중지하기 - 때문입니다. 대조적으로, <function>preg_match_all</function>는 - <parameter>subject</parameter>의 끝까지 계속해서 실행합니다. - 에러가 발생하면, <function>preg_match</function>는 &false;를 반환합니다. - </para> - <tip> - <para> - 단순히 하나의 문자열이 다른 문자열에 들어있는지를 확인하고 싶을때는 - <function>preg_match</function>를 사용하지 마십시오. 대신, - <function>strpos</function>나 <function>strstr</function>를 사용하는 - 편이 더욱 빠릅니다. - </para> - </tip> - <para> - <example> - <title>문자열 "php" 찾기</title> - <programlisting role="php"> +<!-- EN-Revision: 1.27 Maintainer: progcom Status: ready --> +<refentry xml:id="function.preg-match" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>preg_match</refname> + <refpurpose>정규표현식 매치를 수행</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>int</type><methodname>preg_match</methodname> + <methodparam><type>string</type><parameter>pattern</parameter></methodparam> + <methodparam><type>string</type><parameter>subject</parameter></methodparam> + <methodparam choice="opt"><type>array</type><parameter role="reference">matches</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam> + </methodsynopsis> + <para> + <parameter>pattern</parameter>에 주어진 정규표현식을 + <parameter>subject</parameter>에서 찾습니다. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>pattern</parameter></term> + <listitem> + <para> + 탐색할 패턴 문자열. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>subject</parameter></term> + <listitem> + <para> + 입력 문자열. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>matches</parameter></term> + <listitem> + <para> + <parameter>matches</parameter>가 주어지면, 검색 결과를 채워넣습니다. + <varname>$matches[0]</varname>는 전체 패턴 텍스트가 들어가고, + <varname>$matches[1]</varname>부터 괄호로 둘러싸인 서브 패턴을 + 채워넣습니다. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>flags</parameter></term> + <listitem> + <para> + <parameter>flags</parameter>는 다음과 같은 플래그를 사용할 수 있습니다: + <variablelist> + <varlistentry> + <term><constant>PREG_OFFSET_CAPTURE</constant></term> + <listitem> + <simpara> + 이 플래그를 넘기면, 모든 매치에 대한 문자열 시작 위치를 함께 + 반환합니다. 반환값을 <literal>0</literal>에 매치한 문자열을 가지고, + <literal>1</literal>에 문자열 시작 위치를 가지는 배열을 원소로 갖는 + 배열로 변경하는 점에 주의하십시오. + </simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>offset</parameter></term> + <listitem> + <para> + 일반적으로, 검색은 목표 문자열의 처음에서 시작합니다. 선택적인 인수 + <parameter>offset</parameter>으로 검색을 시작할 다른 위치를 지정할 수 + 있습니다. (바이트 단위) + </para> + <note> + <para> + <parameter>offset</parameter>을 사용하는 것은 + <function>preg_match</function>의 주제 문자열로 + <literal>substr($subject, $offset)</literal>을 사용하는 것과 + 다릅니다. <parameter>pattern</parameter>에 <emphasis>^</emphasis>, + <emphasis>$</emphasis>, <emphasis>(?&lt;=x)</emphasis> 등의 단정을 + 포함할 수 있기 때문입니다. 비교: + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +$subject = "abcdef"; +$pattern = '/^def/'; +preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3); +print_r($matches); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Array +( +) +]]> + </screen> + <para> + 반면 이 예제는 + </para> + <programlisting role="php"> +<![CDATA[ +<?php +$subject = "abcdef"; +$pattern = '/^def/'; +preg_match($pattern, substr($subject,3), $matches, PREG_OFFSET_CAPTURE); +print_r($matches); +?> +]]> + </programlisting> + <para> + 다음 결과가 됩니다 + </para> + <screen> +<![CDATA[ +Array +( + [0] => Array + ( + [0] => def + [1] => 0 + ) + +) +]]> + </screen> + </informalexample> + </para> + </note> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + <function>preg_match</function>는 <parameter>pattern</parameter>이 + 매치된 횟수를 반환합니다. 이는 0(매치 없음)이나 1입니다. + <function>preg_match</function>는 처음 매치 후에 검색을 중지하기 + 때문입니다. 대조적으로, <function>preg_match_all</function>는 + <parameter>subject</parameter>의 끝까지 계속해서 실행합니다. + 에러가 발생하면, <function>preg_match</function>는 &false;를 반환합니다. + </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>4.3.3</entry> + <entry> + <parameter>offset</parameter> 인수 추가 + </entry> + </row> + <row> + <entry>4.3.0</entry> + <entry> + <constant>PREG_OFFSET_CAPTURE</constant> 플래그 추가 + </entry> + </row> + <row> + <entry>4.3.0</entry> + <entry> + <parameter>flags</parameter> 인수 추가 + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>문자열 "php" 찾기</title> + <programlisting role="php"> <![CDATA[ <?php // 패턴 구분자 뒤의 "i"는 대소문자를 구별하지 않게 합니다. @@ -83,13 +211,13 @@ } ?> ]]> - </programlisting> - </example> - </para> - <para> - <example> - <title>단어 "Web" 찾기</title> - <programlisting role="php"> + </programlisting> + </example> + </para> + <para> + <example> + <title>단어 "Web" 찾기</title> + <programlisting role="php"> <![CDATA[ <?php /* 패턴에서 \b는 단어를 지시합니다. 단어 "web"만 매치하고, @@ -107,43 +235,90 @@ } ?> ]]> - </programlisting> - </example> - </para> - <para> - <example> - <title>URL에서 도메인 이름 얻기</title> - <programlisting role="php"> + </programlisting> + </example> + </para> + <para> + <example> + <title>URL에서 도메인 이름 얻기</title> + <programlisting role="php"> <![CDATA[ <?php // URL에서 호스트 이름 얻기 -preg_match("/^(http:\/\/)?([^\/]+)/i", +preg_match('@^(?:http://)?([^/]+)@i', "http://www.php.net/index.html", $matches); -$host = $matches[2]; +$host = $matches[1]; // 호스트 이름에서 마지막 두 세그멘트 얻기 -preg_match("/[^\.\/]+\.[^\.\/]+$/", $host, $matches); +preg_match('/[^.]+\.[^.]+$/', $host, $matches); echo "도메인 이름은: {$matches[0]}\n"; ?> ]]> - </programlisting> - <para> - 이 예제의 결과: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 도메인 이름은: php.net ]]> - </screen> - </example> - </para> - <para> - 참고: <function>preg_match_all</function>, - <function>preg_replace</function>, - <function>preg_split</function>. - </para> - </refsect1> - </refentry> + </screen> + </example> + </para> + <para> + <example> + <title>이름 있는 서브패턴 사용하기</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$str = 'foobar: 2008'; + +preg_match('/(?<name>\w+): (?<digit>\d+/', $str, $matches); + +print_r($matches); + +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Array +( + [0] => foobar: 2008 + [name] => foobar + [1] => foobar + [digit] => 2008 + [2] => 2008 +) +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <tip> + <para> + 하나의 문자열이 다른 문자열에 들어있는지 확인하기 위해서 + <function>preg_match</function>를 사용하지 마십시오. 더욱 빠른 + <function>strpos</function>나 <function>strstr</function>을 사용하십시오. + </para> + </tip> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>preg_match_all</function></member> + <member><function>preg_replace</function></member> + <member><function>preg_split</function></member> + </simplelist> + </para> + </refsect1> + +</refentry> <!-- Keep this comment at the end of the file Local variables: @@ -165,4 +340,3 @@ vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> - http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/strings/charsets.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-kr/reference/strings/charsets.xml diff -u phpdoc-kr/reference/strings/charsets.xml:1.3 phpdoc-kr/reference/strings/charsets.xml:1.4 --- phpdoc-kr/reference/strings/charsets.xml:1.3 Sat Jun 23 13:51:42 2007 +++ phpdoc-kr/reference/strings/charsets.xml Thu Nov 13 15:40:53 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- EN-Revision: 1.7 Maintainer: progcom Status: ready --> <para xmlns="http://docbook.org/ns/docbook"> PHP 4.3.0 이상에서 다음 문자셋을 지원합니다. @@ -48,7 +48,7 @@ <entry>cp1251</entry> <entry>Windows-1251, win-1251, 1251</entry> <entry> - 윈도우즈-특정 키릴 문자셋. + 윈도우-특정 키릴 문자셋. 이 문자셋은 4.3.2부터 지원합니다. </entry> </row> @@ -56,7 +56,7 @@ <entry>cp1252</entry> <entry>Windows-1252, 1252</entry> <entry> - 윈도우즈 특정 서부 유럽어 문자셋 + 윈도우 특정 서부 유럽어 문자셋 </entry> </row> <row> http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/strings/functions/quotemeta.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-kr/reference/strings/functions/quotemeta.xml diff -u phpdoc-kr/reference/strings/functions/quotemeta.xml:1.3 phpdoc-kr/reference/strings/functions/quotemeta.xml:1.4 --- phpdoc-kr/reference/strings/functions/quotemeta.xml:1.3 Sat Jun 23 13:51:42 2007 +++ phpdoc-kr/reference/strings/functions/quotemeta.xml Thu Nov 13 15:40:53 2008 @@ -1,31 +1,70 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.2 Maintainer: progcom Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: progcom Status: ready --> <!-- CREDITS: cycle98 --> - <refentry xml:id="function.quotemeta" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>quotemeta</refname> - <refpurpose>메타 문자를 인용합니다.</refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>string</type><methodname>quotemeta</methodname> - <methodparam><type>string</type><parameter>str</parameter></methodparam> - </methodsynopsis> - <para> - 모든 <screen>. \\ + * ? [ ^ ] ( $ )</screen> 문자 앞에 - 백슬래쉬(<literal>\</literal>)를 덧붙인 <parameter>str</parameter>을 - 반환합니다. - </para> - <simpara> - 참고: <function>addslashes</function>, - <function>htmlentities</function>, - <function>htmlspecialchars</function>, - <function>nl2br</function>, - <function>stripslashes</function>. - </simpara> - </refsect1> - </refentry> +<refentry xml:id="function.quotemeta" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>quotemeta</refname> + <refpurpose>메타 문자를 인용</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>quotemeta</methodname> + <methodparam><type>string</type><parameter>str</parameter></methodparam> + </methodsynopsis> + <para> + 다음의 모든 문자 앞에 백슬래시 문자(<literal>\</literal>)를 덧붙인 str을 + 반환합니다: + <screen>. \ + * ? [ ^ ] ( $ )</screen> + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>str</parameter></term> + <listitem> + <para> + 입력 문자열. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + 메타 문자를 인용한 문자열을 반환합니다. + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + &note.bin-safe; + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>addslashes</function></member> + <member><function>addcslashes</function></member> + <member><function>htmlentities</function></member> + <member><function>htmlspecialchars</function></member> + <member><function>nl2br</function></member> + <member><function>stripslashes</function></member> + <member><function>stripcslashes</function></member> + <member><function>ereg</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/sprintf.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc-kr/reference/strings/functions/sprintf.xml diff -u phpdoc-kr/reference/strings/functions/sprintf.xml:1.8 phpdoc-kr/reference/strings/functions/sprintf.xml:1.9 --- phpdoc-kr/reference/strings/functions/sprintf.xml:1.8 Mon Nov 10 07:09:24 2008 +++ phpdoc-kr/reference/strings/functions/sprintf.xml Thu Nov 13 15:40:53 2008 @@ -1,189 +1,336 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.8 Maintainer: progcom Status: ready --> - <refentry xml:id="function.sprintf" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>sprintf</refname> - <refpurpose>형식화한 문자열을 반환합니다.</refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>string</type><methodname>sprintf</methodname> - <methodparam><type>string</type><parameter>format</parameter></methodparam> - <methodparam choice="opt"><type>mixed</type><parameter>args</parameter></methodparam> - </methodsynopsis> - <simpara> - 포맷 문자열 <parameter>format</parameter>에 따라 생성한 문자열을 - 반환합니다. - </simpara> - <simpara> - 포맷 문자열은 0개 이상의 지시어를 조합합니다: 일반 문자는 - (<literal>%</literal>을 제외하고) 결과에 그대로 복사하고, <emphasis>변환 - 특정어</emphasis>는 각각의 인수로 교체한 결과를 가집니다. 이는 - <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> - 인수를 정수로 취급하고, 2진수로 표현합니다. - </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> - <para> - PHP 4.0.6부터 포맷 문자열은 인수 넘버링/교환을 지원합니다. 다음은 - 예제입니다: - <example> - <title>인수 교환</title> - <programlisting role="php"> +<!-- EN-Revision: 1.20 Maintainer: progcom Status: ready --> +<refentry xml:id="function.sprintf" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>sprintf</refname> + <refpurpose>형식화한 문자열을 반환</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>sprintf</methodname> + <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>에 따라 생성한 문자열을 + 반환합니다. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>format</parameter></term> + <listitem> + <para> + 포맷 문자열은 0개 이상의 지시어를 조합합니다: 일반 문자는 + (<literal>%</literal>을 제외하고) 결과에 그대로 복사하고, <emphasis>변환 + 특정어</emphasis>는 각각의 인수로 교체한 결과를 가집니다. 이는 + <function>sprintf</function>와 <function>printf</function>에 모두 + 적용됩니다. + </para> + <para> + 각각의 변환 특정어는 퍼센트 기호(<literal>%</literal>)에 다음의 요소들이 + 붙어서 구성됩니다: + <orderedlist> + <listitem> + <simpara> + 선택적인 <emphasis>부호 지정어</emphasis>는 숫자에 부호(-나 +)를 + 강제합니다. 기본값은 숫자가 음수일때만 - 부호를 사용합니다. 이 + 지정어는 양수일때도 + 부호를 붙이고, PHP 4.3.0에서 추가되었습니다. + </simpara> + </listitem> + <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>는 부동소수점 수에서 + 얼마나 많은 소수점 아래의 수를 표시할지를 결정합니다. 이 지정어를 + 문자열에 사용하면, 잘라내는 점으로 작동하여 문자열의 최대 문자수를 + 제한합니다. + </simpara> + </listitem> + <listitem> + <para> + <emphasis>형 지정어</emphasis>는 인수 데이터를 어떤 형으로 취급할지 + 결정합니다. 가능한 형은: + <simplelist> + <member> + <literal>%</literal> - 퍼센트 문자. 인수는 필요하지 않습니다. + </member> + <member> + <literal>b</literal> - 인수를 정수로 취급하고, 2진수로 표현합니다. + </member> + <member> + <literal>c</literal> - 인수를 정수로 취급하고, ASCII 값에 해당하는 + 문자로 표현합니다. + </member> + <member> + <literal>d</literal> - 인수를 정수로 취급하고, (부호 있는) 10진수로 + 표현합니다. + </member> + <member> + <literal>e</literal> - 인수를 과학 형식으로 취급합니다. (예. + 1.2e+2) 정밀도 지정어는 PHP 5.2.1부터 소수점 아래 자리수를 + 정합니다. 이전 버전에서는 유효숫자의 갯수(하나 적음)로 + 취급했었습니다. + </member> + <member> + <literal>u</literal> - 인수를 정수로 취급하고, 부호 없는 10진수로 + 표현합니다. + </member> + <member> + <literal>f</literal> - 인수를 소수로 취급하고, 부동소수점 수로 + 표현합니다. (로케일 관련) + </member> + <member> + <literal>F</literal> - 인수를 소수로 취급하고, 부동소수점 수로 + 표현합니다. (로케일 무관) PHP 4.3.10과 PHP 5.0.3부터 사용할 수 + 있습니다. + </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> + <para> + 포맷 문자열은 인수 넘버링/교환을 지원합니다. 다음은 예제입니다: + <example> + <title>인수 교환</title> + <programlisting role="php"> <![CDATA[ <?php -$format = "There are %d monkeys in the %s"; +$format = ;There are %d monkeys in the %s'; printf($format, $num, $location); ?> ]]> - </programlisting> - </example> - 이는 "There are 5 monkeys in the tree"를 출력할 것입니다. 그러나, - 국제화를 위해서 포맷 문자열을 별도의 파일로 작성하고, 이것을 다음과 같이 - 재작성했다고 생각해봅시다: - <example> - <title>인수 교환</title> - <programlisting role="php"> + </programlisting> + </example> + 이는 "There are 5 monkeys in the tree"를 출력할 것입니다. 그러나, + 국제화를 위해서 포맷 문자열을 별도의 파일로 작성하고, 이것을 다음처럼 + 재작성했다고 생각해봅시다: + <example> + <title>인수 교환</title> + <programlisting role="php"> <![CDATA[ <?php -$format = "The %s contains %d monkeys"; +$format = 'The %s contains %d monkeys'; printf($format, $num, $location); ?> ]]> - </programlisting> - </example> - 문제가 생겼습니다. 포맷 문자열에서의 순서와 코드에서 인수의 순서가 - 일치하지 않습니다. 여기서 코드를 수정하지 않고, 단순히 포맷 문자열에 어떤 - 인수를 가져올지를 지정할 수 있습니다. 포맷 문자열을 다음과 같이 작성하면 - 됩니다: - <example> - <title>인수 교환</title> - <programlisting role="php"> + </programlisting> + </example> + 문제가 생겼습니다. 포맷 문자열에서의 순서와 코드에서 인수의 순서가 + 일치하지 않습니다. 여기서 코드를 수정하지 않고, 단순히 포맷 문자열에 어떤 + 인수를 가져올지를 지정할 수 있습니다. 포맷 문자열을 다음과 같이 작성하면 + 됩니다: + <example> + <title>인수 교환</title> + <programlisting role="php"> <![CDATA[ <?php -$format = "The %2\$s contains %1\$d monkeys"; +$format = 'The %2$s contains %1$d monkeys'; printf($format, $num, $location); ?> ]]> - </programlisting> - </example> - 코드에 많은 인수를 추가하지 않고도 반복해서 출력할 수 있다는 추가적인 - 장점이 존재합니다. 예를 들면: - <example> - <title>인수 교환</title> - <programlisting role="php"> + </programlisting> + </example> + 코드에 많은 인수를 추가하지 않고도 반복해서 출력할 수 있다는 추가적인 + 장점이 존재합니다. 예를 들면: + <example> + <title>인수 교환</title> + <programlisting role="php"> <![CDATA[ <?php -$format = "The %2\$s contains %1\$d monkeys. - That's a nice %2\$s full of %1\$d monkeys."; +$format = 'The %2$s contains %1$d monkeys. + That\'s a nice %2$s full of %1$d monkeys.'; printf($format, $num, $location); ?> ]]> - </programlisting> - </example> - </para> - <simpara> - 참고: <function>printf</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"> + </programlisting> + </example> + </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> + 형식화 문자열 <parameter>format</parameter>에 따라서 생성된 문자열을 + 반환합니다. + </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>4.0.6</entry> + <entry> + 인수 넘버링/교환 추가. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <example> + <title><function>printf</function>: 다양한 예제</title> + <programlisting role="php"> +<![CDATA[ +<?php +$n = 43951789; +$u = -43951789; +$c = 65; // ASCII 65는 'A' + +// 이중 %%에 주목, '%' 문자를 출력합니다. +printf("%%b = '%b'\n", $n); // 2진 표현 +printf("%%c = '%c'\n", $c); // 아스키 문자 출력, chr() 함수와 동일 +printf("%%d = '%d'\n", $n); // 표준 정수 +printf("%%e = '%e'\n", $n); // 과학 표현 +printf("%%u = '%u'\n", $n); // 양의 정수에 대한 부호 없는 정수 표현 +printf("%%u = '%u'\n", $u); // 음의 정수에 대한 부호 없는 정수 표현 +printf("%%f = '%f'\n", $n); // 부동소수점 표현 +printf("%%o = '%o'\n", $n); // 8진 표현 +printf("%%s = '%s'\n", $n); // 문자열 표현 +printf("%%x = '%x'\n", $n); // 16진 표현 (소문자) +printf("%%X = '%X'\n", $n); // 16진 표현 (대문자) + +printf("%%+d = '%+d'\n", $n); // 양의 정수에 대한 부호지정어 +printf("%%+d = '%+d'\n", $u); // 음의 정수에 대한 부호지정어 +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +%b = '10100111101010011010101101' +%c = 'A' +%d = '43951789' +%e = '4.39518e+7' +%u = '43951789' +%u = '4251015507' +%f = '43951789.000000' +%o = '247523255' +%s = '43951789' +%x = '29ea6ad' +%X = '29EA6AD' +%+d = '+43951789' +%+d = '-43951789' +]]> + </screen> + </example> + <example> + <title><function>printf</function>: 문자열 지정어</title> + <programlisting role="php"> +<![CDATA[ +<?php +$s = 'monkey'; +$t = 'many monkeys'; + +printf("[%s]\n", $s); // 표준 문자열 출력 +printf("[%10s]\n" $s); // 공백으로 오른쪽 정렬 +printf("[%-10s]\n", $s); // 공백으로 왼쪽 정렬 +printf("[%010s]\n", $s); // 0 채우기도 문자열에 작동 +printf("[%'#10s]\n", $s); // 사용자 채우기 문자 '#' 사용 +printf("[%10.10s]\n", $t); // 왼쪽 정렬이지만 10문자로 자름 +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +[monkey] +[ monkey] +[monkey ] +[0000monkey] +[####monkey] +[many monke] +]]> + </screen> + </example> + <example> + <title><function>sprintf</function>: 0으로 채운 정수</title> + <programlisting role="php"> <![CDATA[ <?php $isodate = sprintf("%04d-%02d-%02d", $year, $month, $day); ?> ]]> - </programlisting> - </example> - <example> - <title><function>sprintf</function>: 통화 표현하기</title> - <programlisting role="php"> + </programlisting> + </example> + <example> + <title><function>sprintf</function>: 통화 표현하기</title> + <programlisting role="php"> <![CDATA[ <?php $money1 = 68.75; @@ -194,11 +341,36 @@ // echo $formatted 는 "123.10"를 출력합니다. ?> ]]> - </programlisting> - </example> - </para> - </refsect1> - </refentry> + </programlisting> + </example> + <example> + <title><function>sprintf</function>: 과학 표현</title> + <programlisting role="php"> +<![CDATA[ +<?php +$number = 362525200; + +echo sprintf("%.3e", $number); // 3.625e+8 출력 +?> +]]> + </programlisting> + </example> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>printf</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/str-repeat.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-kr/reference/strings/functions/str-repeat.xml diff -u phpdoc-kr/reference/strings/functions/str-repeat.xml:1.3 phpdoc-kr/reference/strings/functions/str-repeat.xml:1.4 --- phpdoc-kr/reference/strings/functions/str-repeat.xml:1.3 Sat Jun 23 13:51:42 2007 +++ phpdoc-kr/reference/strings/functions/str-repeat.xml Thu Nov 13 15:40:53 2008 @@ -1,44 +1,95 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.6 Maintainer: progcom Status: ready --> +<!-- EN-Revision: 1.11 Maintainer: progcom Status: ready --> <!-- CREDITS: cycle98 --> - <refentry xml:id="function.str-repeat" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>str_repeat</refname> - <refpurpose>문자열을 반복합니다.</refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>string</type><methodname>str_repeat</methodname> - <methodparam><type>string</type><parameter>input</parameter></methodparam> - <methodparam><type>int</type><parameter>multiplier</parameter></methodparam> - </methodsynopsis> - <para> - <parameter>multiplier</parameter>번 반복한 - <parameter>input_str</parameter>을 반환합니다. - <parameter>multiplier</parameter>는 0 이상이여야 합니다. - <parameter>multiplier</parameter>를 0으로 설정하면, 빈 문자열을 - 반환합니다. - </para> - <example> - <title><function>str_repeat</function> 예제</title> - <programlisting role="php"> +<refentry xml:id="function.str-repeat" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>str_repeat</refname> + <refpurpose>문자열을 반복</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>str_repeat</methodname> + <methodparam><type>string</type><parameter>input</parameter></methodparam> + <methodparam><type>int</type><parameter>multiplier</parameter></methodparam> + </methodsynopsis> + <para> + <parameter>multiplier</parameter>번 반복한 + <parameter>input</parameter>을 반환합니다. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>input</parameter></term> + <listitem> + <para> + 반복할 문자열. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>multiplier</parameter></term> + <listitem> + <para> + <parameter>input</parameter> 문자열을 반복할 횟수. + </para> + <para> + <parameter>multiplier</parameter>는 0 이상이여야 합니다. + <parameter>multiplier</parameter>를 0으로 설정하면, 빈 문자열을 + 반환합니다. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + 반복한 문자열을 반환합니다. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>str_repeat</function> 예제</title> + <programlisting role="php"> <![CDATA[ <?php echo str_repeat("-=", 10); ?> ]]> - </programlisting> - </example> - <para> - 이는 "-=-=-=-=-=-=-=-=-=-="를 출력합니다. - </para> - <para> - 참고: <link linkend="control-structures.for">for</link>, - <function>str_pad</function>, <function>substr_count</function>. - </para> - </refsect1> - </refentry> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +-=-=-=-=-=-=-=-=-=-= +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><link linkend="control-structures.for">for</link></member> + <member><function>str_pad</function></member> + <member><function>substr_count</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/str-replace.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc-kr/reference/strings/functions/str-replace.xml diff -u phpdoc-kr/reference/strings/functions/str-replace.xml:1.6 phpdoc-kr/reference/strings/functions/str-replace.xml:1.7 --- phpdoc-kr/reference/strings/functions/str-replace.xml:1.6 Mon Nov 10 07:09:24 2008 +++ phpdoc-kr/reference/strings/functions/str-replace.xml Thu Nov 13 15:40:53 2008 @@ -1,62 +1,141 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.13 Maintainer: progcom Status: ready --> - <refentry xml:id="function.str-replace" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>str_replace</refname> - <refpurpose> - 발견한 모든 검색 문자열을 치환 문자열로 교체합니다. - </refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>mixed</type><methodname>str_replace</methodname> - <methodparam><type>mixed</type><parameter>search</parameter></methodparam> - <methodparam><type>mixed</type><parameter>replace</parameter></methodparam> - <methodparam><type>mixed</type><parameter>subject</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>&amp;count</parameter></methodparam> - </methodsynopsis> - <para> - <parameter>subject</parameter>에서 발견한 모든 - <parameter>search</parameter>를 주어진 <parameter>replace</parameter> - 값으로 치환한 문자열이나 배열을 반환합니다. (정규표현식처럼) 복잡한 치환 - 규칙이 필요하지 않다면, 항상 <function>ereg_replace</function>나 - <function>preg_replace</function> 대신 이 함수를 사용해야 합니다. - </para> - <para> - PHP 4.0.5부터, <function>str_replace</function>의 모든 인수를 - <type>array</type>로 지정할 수 있습니다. - </para> - <warning> - <simpara> - PHP 4.3.3 이전 버전에는 <parameter>search</parameter>와 - <parameter>replace</parameter> 인수에 모두 배열을 사용할 경우, 빈 - <parameter>search</parameter> 인덱스를 <parameter>replace</parameter> - 배열의 내부 포인터를 옮기지 않은 채 넘어가는 버그가 존재했습니다. - <literal>PHP 4.3.3</literal>에서 수정했기에, 이 버그에 관련된 모든 - 스크립트는 이전의 동작을 하려면 이 함수를 호출 하기 전에 빈 search값을 - 제거해야 합니다. - </simpara> - </warning> - <para> - <parameter>subject</parameter>가 배열이면, 검색 및 치환을 - <parameter>subject</parameter>의 모든 원소에서 수행하고, 배열을 - 반환합니다. - </para> - <para> - <parameter>search</parameter>와 <parameter>replace</parameter>가 - 배열이면, <function>str_replace</function>는 각각의 배열에서 가져온 값을 - <parameter>subject</parameter>의 검색과 치환에 사용합니다. - <parameter>replace</parameter>가 <parameter>search</parameter>보다 적은 - 값을 가지면, 나머지 치환값은 빈 문자열을 사용합니다. - <parameter>search</parameter>가 배열이고 <parameter>replace</parameter>가 - 문자열이면; 치환 문자열을 모든 <parameter>search</parameter> 값에 - 사용합니다. - </para> - <para> - <example> - <title><function>str_replace</function> 예제</title> - <programlisting role="php"> +<!-- EN-Revision: 1.27 Maintainer: progcom Status: ready --> +<refentry xml:id="function.str-replace" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>str_replace</refname> + <refpurpose>발견한 모든 검색 문자열을 치환 문자열로 교체</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>mixed</type><methodname>str_replace</methodname> + <methodparam><type>mixed</type><parameter>search</parameter></methodparam> + <methodparam><type>mixed</type><parameter>replace</parameter></methodparam> + <methodparam><type>mixed</type><parameter>subject</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter role="reference">count</parameter></methodparam> + </methodsynopsis> + <para> + <parameter>subject</parameter>에서 발견한 모든 + <parameter>search</parameter>를 주어진 <parameter>replace</parameter> + 값으로 치환한 문자열이나 배열을 반환합니다. + </para> + <para> + (정규표현식처럼) 복잡한 치환 + 규칙이 필요하지 않다면, <function>ereg_replace</function>나 + <function>preg_replace</function> 대신 이 함수를 사용해야 합니다. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <parameter>search</parameter>와 <parameter>replace</parameter>가 배열이면, + <function>str_replace</function>는 각가의 배열에서 취한 값을 사용해서 + <parameter>subject</parameter>를 검색 치환합니다. + <parameter>replace</parameter>가 <parameter>search</parameter>보다 적은 + 값을 가지고 있으면, 나머지 치환값으로 빈 문자열을 사용합니다. + <parameter>search</parameter>가 배열이고 <parameter>replace</parameter>가 + 문자열이면, <parameter>search</parameter>의 모든 값에 이 치환 문자열을 + 사용합니다. 반대도 마찬가지입니다. + </para> + <para> + <parameter>search</parameter>나 <parameter>replace</parameter>가 배열이면, + 그 요소는 처음부터 마지막 순으로 처리됩니다. + </para> + <para> + <variablelist> + <varlistentry> + <term><parameter>search</parameter></term> + <listitem> + <para> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>replace</parameter></term> + <listitem> + <para> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>subject</parameter></term> + <listitem> + <para> + <parameter>subject</parameter>가 배열이면, 검색 및 치환을 + <parameter>subject</parameter>의 모든 원소에서 수행하고, 배열을 + 반환합니다. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>count</parameter></term> + <listitem> + <simpara> + 넘겨지면, 매치하여 교체하는 수를 가집니다. + </simpara> + </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.0.0</entry> + <entry> + <parameter>count</parameter> 인수 추가. + </entry> + </row> + <row> + <entry>4.3.3</entry> + <entry> + 이 함수의 동작이 바뀌었습니다. 이전 버전에서는 + <parameter>search</parameter>와 <parameter>replace</parameter> 인수를 + 배열로 사용할 때, <parameter>search</parameter> 인덱스가 비어 있을 + 경우 <parameter>replace</parameter> 배열의 내부 포인트를 증가하지 않고 + 지나치는 버그가 있었습니다. 이는 PHP 4.3.3에서 수정되었으므로, 이 + 버그에 의존하고 있던 모든 스크립트는 이전의 이상한 동작을 재현하려면 + 호출 전에 빈 search 값을 제거해야 합니다. + </entry> + </row> + <row> + <entry>4.0.5</entry> + <entry> + 대부분의 인수가 <type>array</type>를 받습니다. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>str_replace</function> 예제</title> + <programlisting role="php"> <![CDATA[ <?php // 결과: <body text='black'> @@ -76,31 +155,51 @@ // PHP 5.0.0부터 사용할 수있는 count 인수 사용 $str = str_replace("ll", "", "good golly miss molly!", $count); echo $count; // 2 + +// 교체 순서 +$str = "Line 1\nLine 2\rLine 3\r\nLine 4\n"; +$order = array("\r\n", "\n", "\r"); +$replace = '<br />'; +// \r\n을 먼처 처리해서 두번 변환되지 않도록 합니다. +$newstr = str_replace($order, $replace, $str); + +// 출력: apearpearle pear +$letters = array('a', 'p'); +$fruit = array('apple', 'pear'); +$text = 'a p'; +$output = str_replace($letters, $fruit, $text); +echo $output; ?> ]]> - </programlisting> - </example> - </para> - - &note.bin-safe; - - <note> - <simpara> - <literal>PHP 5.0.0</literal>부터 매치하고 치환한 횟수를 참조로 전달하는 - <parameter>count</parameter>로 반환할 수 있습니다. - <literal>PHP 5.0.0</literal> 이전에는 이 인수를 사용할 수 없습니다. - </simpara> - </note> - <para> - 참고: - <function>str_ireplace</function>, - <function>substr_replace</function>, - <function>ereg_replace</function>, - <function>preg_replace</function>, - <function>strtr</function>. - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + &note.bin-safe; + <note> + <para> + 이 함수는 대소문자를 구별합니다. 대소문자를 구별하지 않으려면 + <function>str_ireplace</function>를 사용하십시오. + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>str_ireplace</function></member> + <member><function>substr_replace</function></member> + <member><function>preg_replace</function></member> + <member><function>strtr</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/strcspn.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-kr/reference/strings/functions/strcspn.xml diff -u phpdoc-kr/reference/strings/functions/strcspn.xml:1.3 phpdoc-kr/reference/strings/functions/strcspn.xml:1.4 --- phpdoc-kr/reference/strings/functions/strcspn.xml:1.3 Sat Jun 23 13:51:42 2007 +++ phpdoc-kr/reference/strings/functions/strcspn.xml Thu Nov 13 15:40:53 2008 @@ -1,30 +1,114 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.2 Maintainer: progcom Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: progcom Status: ready --> <!-- CREDITS: cycle98 --> - <refentry xml:id="function.strcspn" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>strcspn</refname> - <refpurpose> - 마스크에 매칭하지 않는 처음 세그먼트의 길이를 찾습니다. - </refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>int</type><methodname>strcspn</methodname> - <methodparam><type>string</type><parameter>str1</parameter></methodparam> - <methodparam><type>string</type><parameter>str2</parameter></methodparam> - </methodsynopsis> - <simpara> - <parameter>str1</parameter>에서 <parameter>str2</parameter> 내의 어떠한 - 문자도 포함하지 <emphasis>않는</emphasis> 첫번째 세그먼트의 길이를 - 반환합니다. - </simpara> - <simpara> - 참고: <function>strspn</function>. - </simpara> - </refsect1> - </refentry> +<refentry xml:id="function.strcspn" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>strcspn</refname> + <refpurpose>마스크에 매칭하지 않는 처음 세그먼트의 길이를 찾습니다</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>int</type><methodname>strcspn</methodname> + <methodparam><type>string</type><parameter>str1</parameter></methodparam> + <methodparam><type>string</type><parameter>str2</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>start</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam> + </methodsynopsis> + <para> + <parameter>str1</parameter>에서 <parameter>str2</parameter> 내의 어떠한 + 문자도 포함하지 <emphasis>않는</emphasis> 첫번째 세그먼트의 길이를 + 반환합니다. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>str1</parameter></term> + <listitem> + <para> + 첫번째 문자열. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>str2</parameter></term> + <listitem> + <para> + 두번째 문자열. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>start</parameter></term> + <listitem> + <para> + 검사할 문자열의 시작 위치. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>length</parameter></term> + <listitem> + <para> + 검사할 문자열의 길이. + </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>4.3.0</entry> + <entry> + <parameter>start</parameter>와 <parameter>length</parameter> 추가 + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + &note.bin-safe; + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>strspn</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/stripslashes.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-kr/reference/strings/functions/stripslashes.xml diff -u phpdoc-kr/reference/strings/functions/stripslashes.xml:1.3 phpdoc-kr/reference/strings/functions/stripslashes.xml:1.4 --- phpdoc-kr/reference/strings/functions/stripslashes.xml:1.3 Sat Jun 23 13:51:42 2007 +++ phpdoc-kr/reference/strings/functions/stripslashes.xml Thu Nov 13 15:40:53 2008 @@ -1,34 +1,65 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.3 Maintainer: progcom Status: ready --> - <refentry xml:id="function.stripslashes" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>stripslashes</refname> - <refpurpose> - <function>addslashes</function>로 처리한 문자열을 되돌립니다. - </refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>string</type><methodname>stripslashes</methodname> - <methodparam><type>string</type><parameter>str</parameter></methodparam> - </methodsynopsis> - <para> - 백슬래쉬를 제거한 문자열을 반환합니다. (<literal>\'</literal>이 - <literal>'</literal>로 되는 방식입니다) 이중 - 백슬래쉬(<literal>\\</literal>)는 단일 백슬래쉬(<literal>\</literal>)로 - 만듭니다. - </para> - <para> - PHP 지시어 <link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link>가 - <literal>on</literal>(기본값으로 on입니다)일 때, 데이터를 이스케이프가 - 필요한 장소(데이터베이스 등)에 놓지 않을 경우의 사용 예제입니다. 예를 - 들면, HTML 폼에서 전달한 데이터를 단순히 바로 출력할 경우입니다. - </para> - <para> - <example> - <title><function>stripslashes</function> 예제</title> - <programlisting role="php"> +<!-- EN-Revision: 1.12 Maintainer: progcom Status: ready --> +<refentry xml:id="function.stripslashes" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>stripslashes</refname> + <refpurpose>따옴표 처리한 문자열을 풉니다</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>stripslashes</methodname> + <methodparam><type>string</type><parameter>str</parameter></methodparam> + </methodsynopsis> + <para> + 따옴표 처리한 문자열을 풀어냅니다. + </para> + <note> + <para> + <link linkend="ini.magic-quotes-sybase">magic_quotes_sybase</link>가 켜져 + 있으면, 백슬래시는 처리되지 않고, 이중 어퍼스트로피를 하나로 교체합니다. + </para> + </note> + <para> + PHP 지시어 <link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link>가 + <literal>on</literal>(기본값으로 on입니다)일 때, 데이터를 이스케이프가 + 필요한 장소(데이터베이스 등)에 놓지 않을 경우의 사용 예제입니다. 예를 + 들면, HTML 폼에서 전달한 데이터를 단순히 바로 출력할 경우입니다. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>str</parameter></term> + <listitem> + <para> + 입력 문자열. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + 백슬래시 처리를 제거한 문자열을 반환합니다. (<literal>\'</literal>이 + <literal>'</literal>이 됩니다) 이중 백슬래시(<literal>\\</literal>)는 + 백슬래시 하나(<literal>\</literal>)가 됩니다. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>stripslashes</function> 예제</title> + <programlisting role="php"> <![CDATA[ <?php $str = "Is your name O\'reilly?"; @@ -37,15 +68,70 @@ echo stripslashes($str); ?> ]]> - </programlisting> - </example> - </para> - <simpara> - 참고: <function>addslashes</function>, - <function>get_magic_quotes_gpc</function>. - </simpara> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + <note> + <para> + <function>stripslashes</function>는 재귀하지 않습니다. 이 함수에 다차원 + 배열을 적용하려면, 재귀 함수를 사용해야 합니다. + </para> + </note> + <para> + <example> + <title>배열에 <function>stripslashes</function> 사용하기</title> + <programlisting role="php"> +<![CDATA[ +<?php +function stripslashes_deep($value) +{ + $value = is_array($value) ? + array_map('stripslashes_deep', $value) : + stripslashes($value); + + return $value; +} + +// 예시 +$array = array("f\\'oo", "\\'ar", array("fo\\'o", "b\\'ar")); +$array = stripslashes_deep($array); + +// 출력 +print_r($array); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Array +( + [0] => f'oo + [1] => b'ar + [2] => Array + ( + [0] => fo'o + [1] => b'ar + ) + +) +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>addslashes</function></member> + <member><function>get_magic_quotes_gpc</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/stristr.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-kr/reference/strings/functions/stristr.xml diff -u phpdoc-kr/reference/strings/functions/stristr.xml:1.3 phpdoc-kr/reference/strings/functions/stristr.xml:1.4 --- phpdoc-kr/reference/strings/functions/stristr.xml:1.3 Sat Jun 23 13:51:42 2007 +++ phpdoc-kr/reference/strings/functions/stristr.xml Thu Nov 13 15:40:53 2008 @@ -1,55 +1,168 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.5 Maintainer: progcom Status: ready --> +<!-- EN-Revision: 1.20 Maintainer: progcom Status: ready --> <!-- CREDITS: cycle98 --> - <refentry xml:id="function.stristr" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>stristr</refname> - <refpurpose> - 대소문자를 구별하지 않는 <function>strstr</function> - </refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>string</type><methodname>stristr</methodname> - <methodparam><type>string</type><parameter>haystack</parameter></methodparam> - <methodparam><type>string</type><parameter>needle</parameter></methodparam> - </methodsynopsis> - <para> - <parameter>haystack</parameter>에서 첫번째 나타나는 - <parameter>needle</parameter>부터 마지막까지 반환합니다. - <parameter>needle</parameter>과 <parameter>haystack</parameter>은 - 대소문자를 구별하지 않습니다. - </para> - <para> - <parameter>needle</parameter>이 발견되지 않으면 &false;를 반환합니다. - </para> - <para> - <parameter>needle</parameter>이 문자열이 아니면, 정수로 변환하고, - 해당하는 순서의 문자값을 적용합니다. - </para> - <para> - <example> - <title><function>stristr</function> 예제</title> - <programlisting role="php"> +<refentry xml:id="function.stristr" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>stristr</refname> + <refpurpose>대소문자를 구분하지 않는 <function>strstr</function></refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>stristr</methodname> + <methodparam><type>string</type><parameter>haystack</parameter></methodparam> + <methodparam><type>mixed</type><parameter>needle</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>before_needle</parameter></methodparam> + </methodsynopsis> + <para> + <parameter>haystack</parameter>에서 첫번째 나타나는 + <parameter>needle</parameter>부터 마지막까지 반환합니다. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>haystack</parameter></term> + <listitem> + <para> + 탐색할 문자열 + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>needle</parameter></term> + <listitem> + <para> + <parameter>needle</parameter>이 문자열이 아니면, 정수로 변환하여 그 + 값의 문자를 취합니다. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>before_needle</parameter></term> + <listitem> + <para> + &true;이면 (기본값은 &false;) <function>stristr</function>은 + <parameter>haystack</parameter>에서 첫 <parameter>needle</parameter> 앞 + 부분을 반환합니다. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + <para> + <parameter>needle</parameter>과 <parameter>haystack</parameter>은 + 대소문자를 구분하지 않습니다. + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + 매치한 문자열 부분을 반환합니다. <parameter>needle</parameter>이 발견되지 + 않으면, &false;를 반환합니다. + </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.3.0</entry> + <entry> + 선택적인 <parameter>before_needle</parameter> 인수 추가 + </entry> + </row> + <row> + <entry>4.3.0</entry> + <entry> + <function>stristr</function>은 바이너리 안전합니다. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>stristr</function> 예제</title> + <programlisting role="php"> <![CDATA[ <?php $email = 'USER@EXAMPLE.com'; - $domain = stristr($email, 'e'); - echo $domain; -// 출력: ER@EXAMPLE.com + echo stristr($email, 'e'); // ER@EXAMPLE.com 출력 + echo stristr($email, 'e', true); // PHP 5.3.0부터, US 출력 ?> ]]> - </programlisting> - </example> - </para> - <para> - 참고: <function>strchr</function>, - <function>strrchr</function>, <function>substr</function>, - <function>ereg</function>. - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + <para> + <example> + <title>문자열의 발견 여부 시험하기</title> + <programlisting role="php"> +<![CDATA[ +<?php + $string = 'Hello World!'; + if(stristr($string, 'earth') === FALSE) { + echo '"earth"를 문자열에서 발견하지 못했습니다.'; + } +// 출력: "earth"를 문자열에서 발견하지 못했습니다. +]]> + </programlisting> + </example> + </para> + <para> + <example> + <title>"문자열"이 아닌 needle 사용하기</title> + <programlisting role="php"> +<![CDATA[ +<?php + $string = 'APPLE'; + echo stristr($string, 97); // 97 = 소문자 a +// 출력: APPLE +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + &note.bin-safe; + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>strstr</function></member> + <member><function>strrchr</function></member> + <member><function>substr</function></member> + <member><function>preg_match</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/zlib/configure.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc-kr/reference/zlib/configure.xml diff -u phpdoc-kr/reference/zlib/configure.xml:1.3 phpdoc-kr/reference/zlib/configure.xml:1.4 --- phpdoc-kr/reference/zlib/configure.xml:1.3 Sat Nov 8 11:54:13 2008 +++ phpdoc-kr/reference/zlib/configure.xml Thu Nov 13 15:40:53 2008 @@ -9,7 +9,7 @@ &windows.builtin; <note> <simpara> - 윈도우즈에서 zlib 지원 내장은 PHP 4.3.0에서 이루어졌습니다. + 윈도우에서 zlib 지원 내장은 PHP 4.3.0에서 이루어졌습니다. </simpara> </note> </section>
« previous php.doc.kr (#772) next »