cvs: phpdoc-kr /features xforms.xml /reference/classobj/functions call-user-method-array.xml class-exists.xml get-class.xml get-parent-class.xml
is-subclass-of.xml method-exists.xml /reference/pcre/functions preg-grep.xml preg-quote.xml preg-split.xml

From: Date: Thu, 20 Nov 2008 16:24:36 +0000
Subject: cvs: phpdoc-kr /features xforms.xml /reference/classobj/functions call-user-method-array.xml class-exists.xml get-class.xml get-parent-class.xml
is-subclass-of.xml method-exists.xml /reference/pcre/functions preg-grep.xml preg-quote.xml preg-split.xml
Groups: php.doc.kr 
Request: Send a blank email to doc-kr+get-782@lists.php.net to get a copy of this message
progcom Thu Nov 20 16:24:36 2008 UTC Added files: /phpdoc-kr/features xforms.xml Modified files: /phpdoc-kr/reference/classobj/functions call-user-method-array.xml class-exists.xml get-class.xml get-parent-class.xml is-subclass-of.xml method-exists.xml /phpdoc-kr/reference/pcre/functions preg-grep.xml preg-quote.xml preg-split.xml Log: sync

http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/classobj/functions/call-user-method-array.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc-kr/reference/classobj/functions/call-user-method-array.xml diff -u phpdoc-kr/reference/classobj/functions/call-user-method-array.xml:1.4 phpdoc-kr/reference/classobj/functions/call-user-method-array.xml:1.5 --- phpdoc-kr/reference/classobj/functions/call-user-method-array.xml:1.4 Sun Nov 9 18:31:47 2008 +++ phpdoc-kr/reference/classobj/functions/call-user-method-array.xml Thu Nov 20 16:24:36 2008 @@ -1,46 +1,51 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.2 Maintainer: fuzzy74 Status: ready --> -<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.36 --> - <refentry xml:id="function.call-user-method-array" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>call_user_method_array</refname> - <refpurpose> - 배열 인수와 함께 사용자 메소드를 호출한다 [낡았음] - </refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>mixed</type><methodname>call_user_method_array</methodname> - <methodparam><type>string</type><parameter>method_name</parameter></methodparam> - <methodparam><type>object</type><parameter>obj</parameter></methodparam> - <methodparam choice="opt"><type>array</type><parameter>paramarr</parameter></methodparam> - </methodsynopsis> - <warning> - <para> - 이 <function>call_user_method_array</function> 함수는 PHP 4.1.0 부터 낡은 함수가 - 되었다. 대신 <literal>array(&amp;$obj, "method_name")</literal> 문법을 갖는 - <function>call_user_func_array</function> 변종(variety)을 사용하도록 한다. - </para> - </warning> - <para> - <parameter>paramarr</parameter> 인수를 사용하여, - 사용자 선언된 <parameter>obj</parameter> 객체에서 <parameter>method_name</parameter>으로 - 참조되는 메소드를 호출한다. - </para> - <para> - <function>call_user_func_array</function>, - <function>call_user_func</function>, - <function>call_user_method</function> 참고. - </para> - <note> - <para> - 이 함수는 PHP 4.0.4pl1 릴리즈 이후의 CVS 코드에 추가되었다. - </para> - </note> - </refsect1> - </refentry> +<!-- EN-Revision: 1.11 Maintainer: progcom Status: ready --> +<!-- CREDITS: fuzzy74 --> +<refentry xml:id="function.call-user-method-array" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>call_user_method_array</refname> + <refpurpose>인수 배열로 사용자 메소드를 호출 [배제됨]</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>mixed</type><methodname>call_user_method_array</methodname> + <methodparam><type>string</type><parameter>method_name</parameter></methodparam> + <methodparam><type>object</type><parameter role="reference">obj</parameter></methodparam> + <methodparam><type>array</type><parameter>params</parameter></methodparam> + </methodsynopsis> + <warning> + <para> + <function>call_user_method_array</function> 함수는 PHP 4.1.0부터 + 배제되었습니다. + </para> + </warning> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>call_user_method_array</function> 대체</title> + <programlisting role="php"> +<![CDATA[ +<?php +call_user_func_array(array($obj, $method_name), $params); +call_user_func_array(array(&$obj, $method_name), $params); // PHP 4 +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>call_user_func_array</function></member> + <member><function>call_user_func</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/classobj/functions/class-exists.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc-kr/reference/classobj/functions/class-exists.xml diff -u phpdoc-kr/reference/classobj/functions/class-exists.xml:1.4 phpdoc-kr/reference/classobj/functions/class-exists.xml:1.5 --- phpdoc-kr/reference/classobj/functions/class-exists.xml:1.4 Sat Jun 23 13:51:38 2007 +++ phpdoc-kr/reference/classobj/functions/class-exists.xml Thu Nov 20 16:24:36 2008 @@ -1,27 +1,134 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.3 Maintainer: fuzzy74 Status: ready --> -<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.11 --> - <refentry xml:id="function.class-exists" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>class_exists</refname> - <refpurpose>클래스가 선언되었는지 검사한다</refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>bool</type><methodname>class_exists</methodname> - <methodparam><type>string</type><parameter>class_name</parameter></methodparam> - </methodsynopsis> - <para> - 이 함수는 <parameter>class_name</parameter> 이라는 클래스가 선언되어있으면, - &true;를 반환하고, 그렇지 않으면 &false;를 반환한다. - </para> - <simpara> - <function>get_declared_classes</function> 참고. - </simpara> - </refsect1> - </refentry> +<!-- EN-Revision: 1.11 Maintainer: progcom Status: ready --> +<refentry xml:id="function.class-exists" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>class_exists</refname> + <refpurpose>클래스가 정의되었는지 확인</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>bool</type><methodname>class_exists</methodname> + <methodparam><type>string</type><parameter>class_name</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>autoload</parameter></methodparam> + </methodsynopsis> + <para> + 주어진 클래스가 정의되었는지 확인합니다. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>class_name</parameter></term> + <listitem> + <para> + 클래스명. 이름은 대소문자를 구분하지 않습니다. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>autoload</parameter></term> + <listitem> + <para> + &link.autoload;로 호출할 지 여부. 기본값은 &true;. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + <parameter>class_name</parameter>이 정의된 클래스이면 &true;, 아니면 + &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.0.2</entry> + <entry> + 정의된 인터페이스에 대해서 &true;를 반환하지 않습니다. + <function>interface_exists</function>를 사용하십시오. + </entry> + </row> + <row> + <entry>5.0.0</entry> + <entry> + <parameter>autoload</parameter> 인수 추가. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>class_exists</function> 예제</title> + <programlisting role="php"> +<![CDATA[ +<?php +// 클래스를 사용하기 전에 존재하는지 확인합니다 +if (class_exists('MyClass')) { + $myclass = new MyClass(); +} + +?> +]]> + </programlisting> + </example> + <example> + <title><parameter>autoload</parameter> 인수 예제</title> + <programlisting role="php"> +<![CDATA[ +<?php +function __autoload($class) +{ + include($class . '.php'); + + // 선언된 클래스를 포함했는지 확인합니다 + if (!class_exists($class, false)) { + trigger_error("Unable to load class: $class", E_USER_WARNING); + } +} + +if (class_exists('MyClass')) { + $myclass = new MyClass(); +} + +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>function_exists</function></member> + <member><function>interface_exists</function></member> + <member><function>get_declared_classes</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/classobj/functions/get-class.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc-kr/reference/classobj/functions/get-class.xml diff -u phpdoc-kr/reference/classobj/functions/get-class.xml:1.4 phpdoc-kr/reference/classobj/functions/get-class.xml:1.5 --- phpdoc-kr/reference/classobj/functions/get-class.xml:1.4 Sat Jun 23 13:51:38 2007 +++ phpdoc-kr/reference/classobj/functions/get-class.xml Thu Nov 20 16:24:36 2008 @@ -1,75 +1,151 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: fuzzy74 Status: ready --> -<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.4 --> - <refentry xml:id="function.get-class" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>get_class</refname> - <refpurpose>객체의 클래스명을 반환한다</refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>string</type><methodname>get_class</methodname> - <methodparam><type>object</type><parameter>obj</parameter></methodparam> - </methodsynopsis> - <para> - 이 함수는 생성된 객체 <parameter>obj</parameter>의 클래스명을 반환한다. - <parameter>obj</parameter>이 객체가 아니면, &false; 를 반환한다. - </para> - <note> - <simpara> - <function>get_class</function>는 사용자 선언된 클래스명을 소문자로 반환한다. - PHP 확장에서 선언된 클래스는 선언명 그대로를 반환한다. - </simpara> - </note> - <para> - <example> - <title><function>get_class</function> 사용예</title> - <programlisting role="php"> +<!-- EN-Revision: 1.12 Maintainer: progcom Status: ready --> +<refentry xml:id="function.get-class" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>get_class</refname> + <refpurpose>객체의 클래스명을 반환</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>get_class</methodname> + <methodparam choice="opt"><type>object</type><parameter>object</parameter></methodparam> + </methodsynopsis> + <para> + 주어진 <parameter>object</parameter>의 클래스명을 얻습니다. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>object</parameter></term> + <listitem> + <para> + 확인하는 객체 + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + <parameter>object</parameter> 인스턴스의 클래스명을 반환합니다. + <parameter>object</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.0.0부터</entry> + <entry> + 클래스명이 원래 문자대로 반환됩니다. + </entry> + </row> + <row> + <entry>5.0.0부터</entry> + <entry> + 객체 메쏘드에서 호출할 때 <parameter>object</parameter> 인수는 + 선택적입니다. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>get_class</function> 사용하기</title> + <programlisting role="php"> <![CDATA[ <?php class foo { - function foo() { - // 일부 로직을 구현 - } - - function name() { + function name() + { echo "My name is " , get_class($this) , "\n"; } } -// 객체를 생성 +// create an object $bar = new foo(); -// 외부 호출 +// external call echo "Its name is " , get_class($bar) , "\n"; -// 내부 호출 +// internal call $bar->name(); ?> ]]> - </programlisting> - <para> - 출력은 다음과 같다: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ Its name is foo My name is foo ]]> - </screen> - </example> - </para> - <para> - <function>get_parent_class</function>, - <function>gettype</function>, - <function>is_subclass_of</function> 참고. - </para> - </refsect1> - </refentry> + </screen> + </example> + <example> + <title>슈퍼클래스에서 <function>get_class</function> 사용하기</title> + <programlisting role="php"> +<![CDATA[ +<?php + +abstract class bar { + public function __construct() + { + var_dump(get_class($this)); + var_dump(get_class()); + } +} + +class foo extends bar { +} + +new foo; + +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +string(3) "foo" +string(3) "bar" +]]> + </screen> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>get_parent_class</function></member> + <member><function>gettype</function></member> + <member><function>is_subclass_of</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/classobj/functions/get-parent-class.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc-kr/reference/classobj/functions/get-parent-class.xml diff -u phpdoc-kr/reference/classobj/functions/get-parent-class.xml:1.4 phpdoc-kr/reference/classobj/functions/get-parent-class.xml:1.5 --- phpdoc-kr/reference/classobj/functions/get-parent-class.xml:1.4 Sat Jun 23 13:51:38 2007 +++ phpdoc-kr/reference/classobj/functions/get-parent-class.xml Thu Nov 20 16:24:36 2008 @@ -1,47 +1,114 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: fuzzy74 Status: ready --> -<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.4 --> - <refentry xml:id="function.get-parent-class" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>get_parent_class</refname> - <refpurpose>객체나 클래스의 부모 클래스명을 가져온다</refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>string</type><methodname>get_parent_class</methodname> - <methodparam><type>mixed</type><parameter>obj</parameter></methodparam> - </methodsynopsis> - <para> - <parameter>obj</parameter>가 객체이면, <parameter>obj</parameter>를 초기화시킨 클래스의 - 부모 클래스명을 반환한다. - </para> - <para> - <parameter>obj</parameter>가 문자열이면, 그 이름을 갖는 클래스의 부모 클래스명을 - 반환한다. 이 기능은 PHP 4.0.5에서 추가되었다. - </para> - <para> - <example> - <title><function>get_parent_class</function> 사용예</title> - <programlisting role="php"> +<!-- EN-Revision: 1.12 Maintainer: progcom Status: ready --> +<refentry xml:id="function.get-parent-class" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>get_parent_class</refname> + <refpurpose>객체나 클래스의 부모 클래스명을 얻습니다</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>get_parent_class</methodname> + <methodparam choice="opt"><type>mixed</type><parameter>object</parameter></methodparam> + </methodsynopsis> + <para> + 객체나 클래스의 부모 클래스명을 획득합니다. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>object</parameter></term> + <listitem> + <para> + 확인하는 객체나 클래스명 + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + <parameter>object</parameter> 인스턴스나 클래스명의 부모 클래스명을 + 반환합니다. + </para> + <note> + <para> + 객체에 부모가 존재하지 않으면 &false;를 반환합니다. + </para> + </note> + <para> + 객체 밖에서 인수 없이 호출하면, &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.1.0 이전</entry> + <entry> + 객체가 밖에서 인수 없이 호출하면, &null;을 반환하고 경고를 + 발생했습니다. + </entry> + </row> + <row> + <entry>5.0.0부터</entry> + <entry> + 객체 메쏘드에서 호출할 때 <parameter>object</parameter> 인수가 + 선택적이 되었습니다. + </entry> + </row> + <row> + <entry>4.0.5부터</entry> + <entry> + <parameter>object</parameter>가 문자열이면, 그 이름을 가진 클래스의 + 부모 클래스명을 반환합니다. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>get_parent_class</function> 사용하기</title> + <programlisting role="php"> <![CDATA[ <?php class dad { - function dad() { + function dad() + { // implements some logic } } class child extends dad { - function child() { + function child() + { echo "I'm " , get_parent_class($this) , "'s son\n"; } } class child2 extends dad { - function child2() { + function child2() + { echo "I'm " , get_parent_class('child2') , "'s son too\n"; } } @@ -51,24 +118,27 @@ ?> ]]> - </programlisting> - <para> - 출력은 다음과 같다: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ I'm dad's son I'm dad's son too ]]> - </screen> - </example> - </para> - <para> - <function>get_class</function>, - <function>is_subclass_of</function> 참고. - </para> - </refsect1> - </refentry> + </screen> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>get_class</function></member> + <member><function>is_subclass_of</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/classobj/functions/is-subclass-of.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc-kr/reference/classobj/functions/is-subclass-of.xml diff -u phpdoc-kr/reference/classobj/functions/is-subclass-of.xml:1.4 phpdoc-kr/reference/classobj/functions/is-subclass-of.xml:1.5 --- phpdoc-kr/reference/classobj/functions/is-subclass-of.xml:1.4 Sat Jun 23 13:51:38 2007 +++ phpdoc-kr/reference/classobj/functions/is-subclass-of.xml Thu Nov 20 16:24:36 2008 @@ -1,33 +1,145 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.3 Maintainer: fuzzy74 Status: ready --> -<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.4 --> - <refentry xml:id="function.is-subclass-of" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>is_subclass_of</refname> - <refpurpose> - 객체가 이 클래스를 부모 클래스로 갖는다면 &true;를 반환한다 - </refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>bool</type><methodname>is_subclass_of</methodname> - <methodparam><type>object</type><parameter>object</parameter></methodparam> - <methodparam><type>string</type><parameter>class_name</parameter></methodparam> - </methodsynopsis> - <para> - 객체 <parameter>object</parameter>가 - <parameter>class_name</parameter>의 하위클래스에 속하면 &true;를 반환하고, - 그렇지 않으면, &false;를 반환한다. - </para> - <simpara> - <function>get_class</function>, - <function>get_parent_class</function>, - <function>is_a</function> 참고. - </simpara> - </refsect1> - </refentry> +<!-- EN-Revision: 1.8 Maintainer: progcom Status: ready --> +<refentry xml:id="function.is-subclass-of" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>is_subclass_of</refname> + <refpurpose>이 클래스가 부모 클래스의 자식인지 확인</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>bool</type><methodname>is_subclass_of</methodname> + <methodparam><type>mixed</type><parameter>object</parameter></methodparam> + <methodparam><type>string</type><parameter>class_name</parameter></methodparam> + </methodsynopsis> + <para> + 주어진 <parameter>object</parameter>의 부모 중에 + <parameter>class_name</parameter> 클래스가 존재하는지 확인합니다. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>object</parameter></term> + <listitem> + <para> + 클래스명이나 객체 인스턴스 + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>class_name</parameter></term> + <listitem> + <para> + 클래스명 + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + <parameter>object</parameter>가 <parameter>class_name</parameter>의 자식 + 클래스면 &true;, 아니면 &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.0.3</entry> + <entry> + <parameter>object</parameter> 인수를 문자열(클래스명)로 지정할 수 + 있습니다. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>is_subclass_of</function> 예제</title> + <programlisting role="php"> +<![CDATA[ +<?php +// 클래스 정의 +class WidgetFactory +{ + var $oink = 'moo'; +} + +// 자식 클래스 정의 +class WidgetFactory_Child extends WidgetFactory +{ + var $oink = 'oink'; +} + +// 새 객체 생성 +$WF = new WidgetFactory(); +$WFC = new WidgetFactory_Child(); + +if (is_subclass_of($WFC, 'WidgetFactory')) { + echo "yes, \$WFC is a subclass of WidgetFactory\n"; +} else { + echo "no, \$WFC is not a subclass of WidgetFactory\n"; +} + + +if (is_subclass_of($WF, 'WidgetFactory')) { + echo "yes, \$WF is a subclass of WidgetFactory\n"; +} else { + echo "no, \$WF is not a subclass of WidgetFactory\n"; +} + + +// PHP 5.3.0부터 사용 가능 +if (is_subclass_of('WidgetFactory_Child', 'WidgetFactory')) { + echo "yes, WidgetFactory_Child is a subclass of WidgetFactory\n"; +} else { + echo "no, WidgetFactory_Child is not a subclass of WidgetFactory\n"; +} +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +yes, $WFC is a subclass of WidgetFactory +no, $WF is not a subclass of WidgetFactory +yes, WidgetFactory_Child is a subclass of WidgetFactory +]]> + </screen> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>get_class</function></member> + <member><function>get_parent_class</function></member> + <member><function>is_a</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/classobj/functions/method-exists.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc-kr/reference/classobj/functions/method-exists.xml diff -u phpdoc-kr/reference/classobj/functions/method-exists.xml:1.4 phpdoc-kr/reference/classobj/functions/method-exists.xml:1.5 --- phpdoc-kr/reference/classobj/functions/method-exists.xml:1.4 Sat Jun 23 13:51:38 2007 +++ phpdoc-kr/reference/classobj/functions/method-exists.xml Thu Nov 20 16:24:36 2008 @@ -1,26 +1,101 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.2 Maintainer: fuzzy74 Status: ready --> -<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.9 --> - <refentry xml:id="function.method-exists" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>method_exists</refname> - <refpurpose>클래스 메소드가 존재하는지 검사한다</refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>bool</type><methodname>method_exists</methodname> - <methodparam><type>object</type><parameter>object</parameter></methodparam> - <methodparam><type>string</type><parameter>method_name</parameter></methodparam> - </methodsynopsis> - <para> - 이 함수는 <parameter>method_name</parameter>에 의해 주어진 메소드가 - 주어진 <parameter>object</parameter>에 대해서 선언되어있으면, &true;를 - 반환하고, 그렇지 않으면 &false;를 반환한다. - </para> - </refsect1> - </refentry> +<!-- EN-Revision: 1.10 Maintainer: progcom Status: ready --> +<refentry xml:id="function.method-exists" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>method_exists</refname> + <refpurpose>클래스 메쏘드가 존재하는지 확인</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>bool</type><methodname>method_exists</methodname> + <methodparam><type>mixed</type><parameter>object</parameter></methodparam> + <methodparam><type>string</type><parameter>method_name</parameter></methodparam> + </methodsynopsis> + <para> + 주어진 <parameter>object</parameter>에 클래스 메쏘드가 존재하는지 + 확인합니다. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>object</parameter></term> + <listitem> + <para> + 객체 인스턴스나 클래스 이름 + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>method_name</parameter></term> + <listitem> + <para> + 메쏘드 이름 + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + 주어진 <parameter>object</parameter>에 주어진 + <parameter>method_name</parameter>이 정의되어 있으면 &true;, 아니면 + &false;를 반환합니다. + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>method_exists</function> 예제</title> + <programlisting role="php"> +<![CDATA[ +<?php +$directory = new Directory('.'); +var_dump(method_exists($directory,'read')); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +bool(true) +]]> + </screen> + </example> + <example> + <title>정적 <function>method_exists</function> 예제</title> + <programlisting role="php"> +<![CDATA[ +<?php +var_dump(method_exists('Directory','read')); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +bool(true) +]]> + </screen> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>function_exists</function></member> + <member><function>is_callable</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-grep.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc-kr/reference/pcre/functions/preg-grep.xml diff -u phpdoc-kr/reference/pcre/functions/preg-grep.xml:1.9 phpdoc-kr/reference/pcre/functions/preg-grep.xml:1.10 --- phpdoc-kr/reference/pcre/functions/preg-grep.xml:1.9 Sun Nov 16 19:51:41 2008 +++ phpdoc-kr/reference/pcre/functions/preg-grep.xml Thu Nov 20 16:24:36 2008 @@ -1,65 +1,122 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.6 Maintainer: progcom Status: ready --> - <refentry xml:id="function.preg-grep" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>preg_grep</refname> - <refpurpose> - 패턴 매치의 배열을 반환합니다. - </refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>array</type><methodname>preg_grep</methodname> - <methodparam><type>string</type><parameter>pattern</parameter></methodparam> - <methodparam><type>array</type><parameter>input</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> - </methodsynopsis> - - <para> - <function>preg_grep</function>은 주어진 <parameter>pattern</parameter>에 - 매치되는 <parameter>input</parameter> 배열의 원소를 포함하는 배열을 - 반환합니다. - </para> - - <para> - PHP 4.0.4부터, <function>preg_grep</function>가 반환하는 결과는 - 입력 배열의 키를 사용합니다. 이 작동이 적합하다고 생각하지 않으면, - <function>preg_grep</function>이 반환한 배열에 - <function>array_values</function>를 사용해서 값을 인덱싱하십시오. - </para> - - <para> - <parameter>flags</parameter>에는 다음 플래그를 지정할 수 있습니다: - <variablelist> - <varlistentry> - <term>PREG_GREP_INVERT</term> - <listitem> - <simpara> - 이 플래그를 넘기면, <function>preg_grep</function>은 주어진 - <parameter>pattern</parameter>에 매치하지 <emphasis>않는</emphasis> - 입력 배열의 원소를 반환합니다. 이 플래그는 PHP 4.2.0부터 사용할 수 - 있습니다. - </simpara> - </listitem> - </varlistentry> - </variablelist> - </para> - <para> - <example> - <title><function>preg_grep</function> 예제</title> - <programlisting role="php"> +<!-- EN-Revision: 1.9 Maintainer: progcom Status: ready --> +<refentry xml:id="function.preg-grep" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>preg_grep</refname> + <refpurpose>패턴 매치한 부분의 배열을 반환</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>array</type><methodname>preg_grep</methodname> + <methodparam><type>string</type><parameter>pattern</parameter></methodparam> + <methodparam><type>array</type><parameter>input</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> + </methodsynopsis> + <para> + <parameter>input</parameter> 배열에서 주어진 + <parameter>pattern</parameter>에 매치한 원소를 포함하는 배열을 반환합니다. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>pattern</parameter></term> + <listitem> + <para> + 검색할 패턴 문자열. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>input</parameter></term> + <listitem> + <para> + 입력 배열. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>flags</parameter></term> + <listitem> + <para> + <constant>PREG_GREP_INVERT</constant>를 설정하면, 입력 배열에서 주어진 + <parameter>pattern</parameter>에 매치하지 <emphasis>않는</emphasis> + 원소를 반환합니다. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + <parameter>input</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.2.0</entry> + <entry> + <parameter>flags</parameter> 인수 추가. + </entry> + </row> + <row> + <entry>4.0.4</entry> + <entry> + <para> + 이 버전 이전에는, 반환하는 배열의 키가 <parameter>input</parameter> + 배열과 관련이 없었습니다. + </para> + <para> + 예전 동작을 실행하려면, 반환된 배열에 + <function>array_values</function>를 사용하여 값을 다시 정렬하십시오. + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>preg_grep</function> 예제</title> + <programlisting role="php"> <![CDATA[ <?php -// 실수를 포함하는 모든 배열 원소를 반환합니다. +// 부동소수점 수를 포함하는 +// 모든 배열 원소를 반환합니다 $fl_array = preg_grep("/^(\d+)?\.\d+$/", $array); ?> ]]> - </programlisting> - </example> - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </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-quote.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc-kr/reference/pcre/functions/preg-quote.xml diff -u phpdoc-kr/reference/pcre/functions/preg-quote.xml:1.6 phpdoc-kr/reference/pcre/functions/preg-quote.xml:1.7 --- phpdoc-kr/reference/pcre/functions/preg-quote.xml:1.6 Sat Jun 23 13:51:41 2007 +++ phpdoc-kr/reference/pcre/functions/preg-quote.xml Thu Nov 20 16:24:36 2008 @@ -1,54 +1,87 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.6 Maintainer: progcom Status: ready --> - <refentry xml:id="function.preg-quote" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>preg_quote</refname> - <refpurpose>정규 표현식 문자를 인용합니다.</refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>string</type><methodname>preg_quote</methodname> - <methodparam><type>string</type><parameter>str</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>delimiter</parameter></methodparam> - </methodsynopsis> - <para> - <function>preg_quote</function>는 <parameter>str</parameter>에서 - 정규 표현식 문법에 포함되는 모든 문자의 앞에 백슬래쉬를 덧붙입니다. - 어떠한 텍스트에 특수 정규 표현식 문자를 포함하는 런타임 문자열을 - 처리할 때 유용합니다. - </para> - <para> - <parameter>delimiter</parameter>를 정의하면, 그 문자들도 - 이스케이프합니다. PCRE 함수에서 요구하는 구분자를 이스케이프 할 - 때 유용합니다. /는 가장 널리 사용되는 구분자입니다. - </para> - <para> - 특수 정규 표현식 문자: - <literal>. \\ + * ? [ ^ ] $ ( ) { } = ! &lt; &gt; | :</literal> - </para> - <para> - <example> - <title><function>preg_quote</function> 예제</title> - <programlisting role="php"> +<!-- EN-Revision: 1.11 Maintainer: progcom Status: ready --> +<refentry xml:id="function.preg-quote" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>preg_quote</refname> + <refpurpose>정규 표현식 문자를 인용</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>preg_quote</methodname> + <methodparam><type>string</type><parameter>str</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>delimiter</parameter></methodparam> + </methodsynopsis> + <para> + <function>preg_quote</function>는 <parameter>str</parameter>에서 + 정규 표현식 문법에 포함되는 모든 문자의 앞에 백슬래쉬를 덧붙입니다. + 어떠한 텍스트에 특수 정규 표현식 문자를 포함하는 런타임 문자열을 + 처리할 때 유용합니다. + </para> + <para> + 정규 표현식 특수 문자는: + <literal>. \ + * ? [ ^ ] $ ( ) { } = ! &lt; &gt; | :</literal> + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>str</parameter></term> + <listitem> + <para> + 입력 문자열. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>delimiter</parameter></term> + <listitem> + <para> + <parameter>delimiter</parameter>를 정의하면, 그 문자들도 + 이스케이프합니다. PCRE 함수에서 요구하는 구분자를 이스케이프 할 + 때 유용합니다. /는 가장 널리 사용되는 구분자입니다. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + 인용한 문자열을 반환합니다. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>preg_quote</function> 예제</title> + <programlisting role="php"> <![CDATA[ <?php -$keywords = "$40 for a g3/400"; -$keywords = preg_quote($keywords, "/"); +$keywords = '$40 for a g3/400'; +$keywords = preg_quote($keywords, '/'); echo $keywords; // \$40 for a g3\/400 를 반환합니다. ?> ]]> - </programlisting> - </example> - </para> - <para> - <example> - <title>텍스트 안의 단어를 이탤릭체로</title> - <programlisting role="php"> + </programlisting> + </example> + </para> + <para> + <example> + <title>텍스트 안의 단어를 기울임꼴로</title> + <programlisting role="php"> <![CDATA[ <?php // 이 예제에서, preg_quote($word)는 정규 표현식에서 -// 특별한 의미를 지니는 별표(*)의 처리에 사용됩니다. +// 특별한 의미를 지니는 애스터라이크(*)의 처리에 사용됩니다. $textbody = "This book is *very* difficult to find."; $word = "*very*"; @@ -57,11 +90,17 @@ $textbody); ?> ]]> - </programlisting> - </example> - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + &note.bin-safe; + </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-split.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc-kr/reference/pcre/functions/preg-split.xml diff -u phpdoc-kr/reference/pcre/functions/preg-split.xml:1.7 phpdoc-kr/reference/pcre/functions/preg-split.xml:1.8 --- phpdoc-kr/reference/pcre/functions/preg-split.xml:1.7 Mon Nov 10 07:09:24 2008 +++ phpdoc-kr/reference/pcre/functions/preg-split.xml Thu Nov 20 16:24:36 2008 @@ -1,72 +1,149 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: 1.10 Maintainer: progcom Status: ready --> - <refentry xml:id="function.preg-split" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>preg_split</refname> - <refpurpose>정규 표션식에 따라 문자열을 나눕니다.</refpurpose> - </refnamediv> - <refsect1> - <title>설명</title> - <methodsynopsis> - <type>array</type><methodname>preg_split</methodname> - <methodparam><type>string</type><parameter>pattern</parameter></methodparam> - <methodparam><type>string</type><parameter>subject</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>limit</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> - </methodsynopsis> - - <para> - <parameter>pattern</parameter>에 매치된 경계에 따라서 나눠진 - <parameter>subject</parameter>의 문자열을 포함하는 배열을 반환합니다. - </para> - - <para> - <parameter>limit</parameter>를 지정하면, <parameter>limit</parameter> - 횟수까지의 나눠진 문자열을 반환하며, <parameter>limit</parameter>가 - -1이면 "무제한"을 의미합니다. 이 값은 <parameter>flags</parameter>를 - 지정할 때 유용합니다. - </para> - - <para> - <parameter>flags</parameter>는 다음 플래그들의 조합을 사용할 수 있습니다 - (bitwise | 연산자로 결합합니다) : - <variablelist> - <varlistentry> - <term><constant>PREG_SPLIT_NO_EMPTY</constant></term> - <listitem> - <simpara> - 이 플래그를 설정하면, <function>preg_split</function>에 의해 비어있지 - 않은 (non-empty) 조각만을 반환합니다. - </simpara> - </listitem> - </varlistentry> - <varlistentry> - <term><constant>PREG_SPLIT_DELIM_CAPTURE</constant></term> - <listitem> - <simpara> - 이 플래그를 설정하면, delimiter 패턴 안의 서브패턴도 검출하고 - 반환합니다. 이 플래그는 4.0.5에서 추가되었습니다. - </simpara> - </listitem> - </varlistentry> - <varlistentry> - <term><constant>PREG_SPLIT_OFFSET_CAPTURE</constant></term> - <listitem> - <para> - 이 플래그를 설정하면, 문자열의 시작 위치도 반환합니다. 반환값이 - 매치된 문자열을 오프셋 <literal>0</literal>으로, 문자열 시작 위치를 - 오프셋 <literal>1</literal>로 가지는 배열을 원소로 갖는 배열로 - 변하는 점에 주의하십시오. 이 플래그는 PHP 4.3.0부터 사용할 수 - 있습니다. - </para> - </listitem> - </varlistentry> - </variablelist> - </para> - <para> - <example> - <title><function>preg_split</function> 예제 : 검색 문자열의 일부만을 얻기</title> - <programlisting role="php"> +<!-- EN-Revision: 1.15 Maintainer: progcom Status: ready --> +<refentry xml:id="function.preg-split" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>preg_split</refname> + <refpurpose>정규 표현식에 따라 문자열을 나눔</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>array</type><methodname>preg_split</methodname> + <methodparam><type>string</type><parameter>pattern</parameter></methodparam> + <methodparam><type>string</type><parameter>subject</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>limit</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> + </methodsynopsis> + <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>limit</parameter></term> + <listitem> + <para> + 지정하면, <parameter>limit</parameter> 회까지 나눠진 문자열을 반환하며, + <parameter>limit</parameter>가 -1이면 "무제한"을 의미합니다. 이 값은 + <parameter>flags</parameter>를 지정할 때 유용합니다. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>flags</parameter></term> + <listitem> + <para> + <parameter>flags</parameter>는 다음 플래그들을 조합할 수 있습니다 + (bitwise | 연산자로 조합합니다) : + <variablelist> + <varlistentry> + <term><constant>PREG_SPLIT_NO_EMPTY</constant></term> + <listitem> + <simpara> + 이 플래그를 설정하면, <function>preg_split</function>에 의해 나눈 + 후 비어있지 않은 조각만을 반환합니다. + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>PREG_SPLIT_DELIM_CAPTURE</constant></term> + <listitem> + <simpara> + 이 플래그를 설정하면, 구분자 패턴 안의 서브패턴도 검출하여 + 반환합니다. + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>PREG_SPLIT_OFFSET_CAPTURE</constant></term> + <listitem> + <para> + 이 플래그를 설정하면, 문자열의 시작 위치도 반환합니다. 반환값이 + 매치된 문자열을 오프셋 <literal>0</literal>으로, 문자열 시작 위치를 + 오프셋 <literal>1</literal>로 가지는 배열을 원소로 갖는 배열로 + 변하는 점에 주의하십시오. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + <parameter>pattern</parameter>에 매치한 경계로 나눠진 + <parameter>subject</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.3.0</entry> + <entry> + <constant>PREG_SPLIT_OFFSET_CAPTURE</constant> 추가 + </entry> + </row> + <row> + <entry>4.0.5</entry> + <entry> + <constant>PREG_SPLIT_DELIM_CAPTURE</constant> 추가 + </entry> + </row> + <row> + <entry>4.0.0</entry> + <entry> + <parameter>flags</parameter> 인수 추가 + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>preg_split</function> 예제 : 검색 문자열의 일부만을 얻기</title> + <programlisting role="php"> <![CDATA[ <?php // " ", \r, \t, \n, \f를 포함하여 @@ -74,13 +151,13 @@ $keywords = preg_split("/[\s,]+/", "hypertext language, programming"); ?> ]]> - </programlisting> - </example> - </para> - <para> - <example> - <title>문자열을 구성 문자로 나누기.</title> - <programlisting role="php"> + </programlisting> + </example> + </para> + <para> + <example> + <title>문자열을 구성 문자로 나누기.</title> + <programlisting role="php"> <![CDATA[ <?php $str = 'string'; @@ -88,13 +165,13 @@ print_r($chars); ?> ]]> - </programlisting> - </example> - </para> - <para> - <example> - <title>매치와 시작위치로 문자열을 나누기.</title> - <programlisting role="php"> + </programlisting> + </example> + </para> + <para> + <example> + <title>매치와 시작위치로 문자열을 나누기.</title> + <programlisting role="php"> <![CDATA[ <?php $str = 'hypertext language programming'; @@ -102,11 +179,9 @@ print_r($chars); ?> ]]> - </programlisting> - <para> - 결과는: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ Array ( @@ -130,21 +205,37 @@ ) ]]> - </screen> - </example> - </para> - <note> - <para> - <parameter>flags</parameter>인수는 PHP 4 베타 3에서 추가되었습니다. - </para> - </note> - <para> - 참고: <function>spliti</function>, <function>split</function>, - <function>implode</function>, <function>preg_match</function>, - <function>preg_match_all</function>, <function>preg_replace</function>. - </para> - </refsect1> - </refentry> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <tip> + <para> + 정규 표현식의 힘이 필요하지 않으면, 더 빠른(그리고 간단한) + <function>explode</function>나 <function>str_split</function>로 대체할 수 + 있습니다. + </para> + </tip> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>spliti</function></member> + <member><function>split</function></member> + <member><function>implode</function></member> + <member><function>preg_match</function></member> + <member><function>preg_match_all</function></member> + <member><function>preg_replace</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/features/xforms.xml?view=markup&rev=1.1 Index: phpdoc-kr/features/xforms.xml +++ phpdoc-kr/features/xforms.xml <?xml version="1.0" encoding="utf-8"?> <!-- EN-Revision: 1.5 Maintainer: progcom Status: ready --> <chapter xml:id="features.xforms" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>XForms 다루기</title> <para> <link xlink:href="&url.xforms;">XForms</link>는 전통적인 웹 폼의 다른 형태를 정의합니다. 보다 많은 플랫폼과 브라우저에서 사용할 수 있고, 심지어 전통적인 매체가 아닌 PDF 문서 등에서도 사용할 수 있습니다. </para> <para> XForms의 첫번째 차이는 폼이 클라이언트에게 전달되는 방법입니다. <link xlink:href="&url.xforms.htmlauthors;">HTML 작성자를 위한 XForms</link>에 XForms를 생성하는 자세한 설명이 있으므로, 여기에서는 간단한 예제만 살펴봅니다. </para> <example> <title>간단한 XForms 검색 폼</title> <programlisting role="html"> <![CDATA[ <h:html xmlns:h="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/2002/xforms"> <h:head> <h:title>Search</h:title> <model> <submission action="http://example.com/search" method="post" id="s"/> </model> </h:head> <h:body> <h:p> <input ref="q"><label>Find</label></input> <submit submission="s"><label>Go</label></submit> </h:p> </h:body> </h:html> ]]> </programlisting> </example> <para> 위 폼은 텍스트 입력 상자(이름은 <parameter>q</parameter>)와 제출 버튼을 표시합니다. 제출 버튼을 클릭하면, 폼은 <literal>action</literal>으로 지정한 페이지로 전송됩니다. </para> <para> 여기에서 웹 응용 프로그램 관점에서 차이를 살펴봅시다. 보통의 HTML 폼에서는 데이터가 <literal>application/x-www-form-urlencoded</literal>로 전송되지만, XForms 세계에서는 XML 형식 데이터로 전송됩니다. </para> <para> 데이터를 XML로 취급한다면 XForms로 작업을 하고 싶을 겁니다. 이 경우, <varname>$HTTP_RAW_POST_DATA</varname>를 살펴보면 브라우저가 생성한 XML 문서를 찾을 수 있습니다. 그대로 좋아하는 XSLT 엔진이나 문서 해석기로 넘길 수 있습니다. </para> <para> 이러한 형식화에 관심이 없고, 전통적인 <varname>$_POST</varname> 변수로 데이터를 받고 싶으면, <parameter>method</parameter> 속성을 <emphasis>urlencoded-post</emphasis>로 바꿔서 클라이언트 브라우저가 <literal>application/x-www-form-urlencoded</literal>로 보내게 할 수 있습니다. </para> <example> <title>XForm을 사용하여 <varname>$_POST</varname> 생성하기</title> <programlisting role="html"> <![CDATA[ <h:html xmlns:h="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/2002/xforms"> <h:head> <h:title>Search</h:title> <model> <submission action="http://example.com/search" method="urlencoded-post" id="s"/> </model> </h:head> <h:body> <h:p> <input ref="q"><label>Find</label></input> <submit submission="s"><label>Go</label></submit> </h:p> </h:body> </h:html> ]]> </programlisting> </example> <note> <simpara> 이 글을 쓰는 시점에서, 많은 브라우저가 XForms를 지원하지 않습니다. 위 예제가 실패한다면 브라우저 버전을 확인해보십시오. </simpara> </note> </chapter> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.doc.kr (#782) next »