cvs: phpdoc-zh /reference/classobj/functions get-class-vars.xml

From: Date: Mon, 31 Mar 2003 14:35:07 +0000
Subject: cvs: phpdoc-zh /reference/classobj/functions get-class-vars.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-1276@lists.php.net to get a copy of this message
nio Mon Mar 31 09:35:07 2003 EDT Added files: /phpdoc-zh/reference/classobj/functions get-class-vars.xml Log: Add file Index: phpdoc-zh/reference/classobj/functions/get-class-vars.xml +++ phpdoc-zh/reference/classobj/functions/get-class-vars.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: nio $ --> <!-- EN-Revision: 1.4 Maintainer: nio Status: ready --> <!-- splitted from ./en/functions/classobj.xml, last change in rev 1.1 --> <refentry id="function.get-class-vars"> <refnamediv> <refname>get_class_vars</refname> <refpurpose> ·µ»ØÓÉÀàµÄĬÈÏÊôÐÔ×é³ÉµÄÊý×é </refpurpose> </refnamediv> <refsect1> <title>ÃèÊö</title> <methodsynopsis> <type>array</type><methodname>get_class_vars</methodname> <methodparam><type>string</type><parameter>class_name</parameter></methodparam> </methodsynopsis> <para> ·µ»ØÓÉÀàµÄĬÈÏÊôÐÔ×é³ÉµÄ¹ØÁªÊý×飬´ËÊý×éµÄÔªËØÒÔ <parameter>varname => value</parameter> µÄÐÎʽ´æÔÚ¡£ </para> <note> <para> ÔÚ PHP 4.2.0 ֮ǰ£¬<function>get_class_vars</function> ²»»á°üº¬Î´³õʼ»¯µÄÀà±äÁ¿¡£ </para> </note> <para> <example> <title><function>get_class_vars</function> ʾÀý</title> <programlisting role="php"> <![CDATA[ <?php class myclass { var $var1; // ´Ë±äÁ¿Ã»ÓÐĬÈÏÖµ¡­¡­ var $var2 = "xyz"; var $var3 = 100; // constructor function myclass() { return(TRUE); } } $my_class = new myclass(); $class_vars = get_class_vars(get_class($my_class)); foreach ($class_vars as $name => $value) { echo "$name : $value\n"; } ?> ]]> </programlisting> </example> </para> <para> ÔËÐнá¹û£º <informalexample> <programlisting> <![CDATA[ // ÔÚ PHP 4.2.0 ֮ǰ var2 : xyz var3 : 100 // ´Ó PHP 4.2.0 ¿ªÊ¼ var1 : var2 : xyz var3 : 100 ]]> </programlisting> </informalexample> </para> <simpara> ²Î¼û <function>get_class_methods</function>¡¢ <function>get_object_vars</function> </simpara> </refsect1> </refentry> <!-- 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.zh (#1276) next »