array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.xmlrpc-get-type.php', 1 => 'xmlrpc_get_type', ), 'up' => array ( 0 => 'ref.xmlrpc.php', 1 => 'XML-RPC 函数', ), 'prev' => array ( 0 => 'function.xmlrpc-encode.php', 1 => 'xmlrpc_encode', ), 'next' => array ( 0 => 'function.xmlrpc-is-fault.php', 1 => 'xmlrpc_is_fault', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/xmlrpc/functions/xmlrpc-get-type.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.1.0, PHP 5, PHP 7)
xmlrpc_get_type — 获取 PHP 值的 xmlrpc 类型
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。
该函数对于 base64 与日期时间字符串特别有用。
value
PHP 值
返回 XML-RPC 类型。
示例 #1 XML-RPC 类型示例
<?php
echo xmlrpc_get_type(null) . "\n"; // base64
echo xmlrpc_get_type(false) . "\n"; // boolean
echo xmlrpc_get_type(1) . "\n"; // int
echo xmlrpc_get_type(1.0) . "\n"; // double
echo xmlrpc_get_type("") . "\n"; // string
echo xmlrpc_get_type(array()) . "\n"; // array
echo xmlrpc_get_type(new stdClass) . "\n"; // array
echo xmlrpc_get_type(STDIN) . "\n"; // int
?>