Php/docs/function.xmlrpc-get-type

来自菜鸟教程
跳转至:导航、​搜索

xmlrpc_get_type

(PHP 4 >= 4.1.0, PHP 5, PHP 7)

xmlrpc_get_type为 PHP 的值获取 xmlrpc 的类型


说明

xmlrpc_get_type ( mixed $value ) : string

Warning 此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。


该函数对于 base64 与日期时间字符串特别有用。


参数

value
PHP value


返回值

Returns the XML-RPC type.


范例

Example #1 XML-RPC type example

<?phpecho xmlrpc_get_type(null) . "\n"; // base64echo xmlrpc_get_type(false) . "\n"; // booleanecho xmlrpc_get_type(1) . "\n"; // intecho xmlrpc_get_type(1.0) . "\n"; // doubleecho xmlrpc_get_type("") . "\n"; // stringecho xmlrpc_get_type(array()) . "\n"; // arrayecho xmlrpc_get_type(new stdClass) . "\n"; // arrayecho xmlrpc_get_type(STDIN) . "\n"; // int?>

参见

  • xmlrpc_set_type() - 为一个 PHP 字符串值设置 xmlrpc 的类型、base64 或日期时间