cvs: phpdoc-zh /reference/var/functions is-scalar.xml

From: Date: Sun, 18 May 2003 10:28:18 +0000
Subject: cvs: phpdoc-zh /reference/var/functions is-scalar.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-1476@lists.php.net to get a copy of this message
nio Sun May 18 06:28:18 2003 EDT Added files: /phpdoc-zh/reference/var/functions is-scalar.xml Log: Add file Index: phpdoc-zh/reference/var/functions/is-scalar.xml +++ phpdoc-zh/reference/var/functions/is-scalar.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: nio $ --> <!-- EN-Revision: 1.2 Maintainer: nio Status: ready --> <!-- splitted from ./en/functions/var.xml, last change in rev 1.35 --> <refentry id="function.is-scalar"> <refnamediv> <refname>is_scalar</refname> <refpurpose> ¼ì²â±äÁ¿ÊÇ·ñÊÇÒ»¸ö±êÁ¿ </refpurpose> </refnamediv> <refsect1> <title>ÃèÊö</title> <methodsynopsis> <type>bool</type><methodname>is_scalar</methodname> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> </methodsynopsis> <para> Èç¹û¸ø³öµÄ±äÁ¿²ÎÊý <parameter>var</parameter> ÊÇÒ»¸ö±êÁ¿£¬<function>is_scalar</function> ·µ»Ø &true;£¬·ñÔò·µ»Ø &false;¡£ </para> <para> ±êÁ¿±äÁ¿ÊÇÖ¸ÄÇЩ°üº¬ÁË<type>ÕûÐÍ</type>¡¢<type>¸¡µãÐÍ</type>¡¢<type>×Ö·û´®</type>»ò<type>²¼¶ûÐÍ</type>µÄ±äÁ¿£¬¶ø<type>Êý×é</type>¡¢<type>¶ÔÏó</type>ºÍ<type>×ÊÔ´</type>Ôò²»ÊDZêÁ¿¡£ <informalexample> <programlisting role="php"> <!-- TODO: better example, this one can be quite misleading for unexperienced programmers. --> <![CDATA[ function show_var($var) { if (is_scalar($var)) { echo $var; } else { var_dump($var); } } $pi = 3.1416; $proteins = array("hemoglobin", "cytochrome c oxidase", "ferredoxin"); show_var($pi); // ´òÓ¡£º3.1416 show_var($proteins) // ´òÓ¡£º // array(3) { // [0]=> // string(10) "hemoglobin" // [1]=> // string(20) "cytochrome c oxidase" // [2]=> // string(10) "ferredoxin" // } ]]> </programlisting> </informalexample> </para> <note> <para> ¾¡¹Üµ±Ç°µÄ<type>×ÊÔ´</type>ÀàÐÍÊǾÓÓÚÕûÊýµÄ£¬µ« <function>is_scalar</function> ²»»á°ÑËüÃǵ±×÷ÊDZêÁ¿£¬ÒòΪ×ÊÔ´ÊdzéÏóÊý¾ÝÀàÐÍ¡£²»ÄÜÒÀÀµÓÚÖ´ÐÐϸ½Ú£¬ÒòΪËü¿ÉÄÜ»á¸Ä±ä¡£ </para> </note> <para> ²Î¼û <function>is_bool</function>¡¢<function>is_numeric</function>¡¢<function>is_float</function>¡¢<function>is_int</function>¡¢<function>is_real</function>¡¢<function>is_string</function>¡¢<function>is_object</function>¡¢<function>is_array</function> ºÍ <function>is_integer</function>¡£ </para> </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 (#1476) next »