xmlrpc_get_type
(PHP 4 >= 4.1.0, PHP 5)
xmlrpc_get_type — Gets xmlrpc type for a PHP value
Description
Warning
This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk.
This function is especially useful for base64 and datetime strings.
Parameters
-
value
-
PHP value
Return Values
Returns the XML-RPC type.
Examples
Example #1 XML-RPC type example
<?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
?>
- xmlrpc_decode_request
- xmlrpc_decode
- xmlrpc_encode_request
- xmlrpc_encode
- xmlrpc_get_type
- xmlrpc_is_fault
- xmlrpc_parse_method_descriptions
- xmlrpc_server_add_introspection_data
- xmlrpc_server_call_method
- xmlrpc_server_create
- xmlrpc_server_destroy
- xmlrpc_server_register_introspection_callback
- xmlrpc_server_register_method
- xmlrpc_set_type
Коментарии
This function returns the type of a PHP variable in XML-RPC terms. It won't "spot" base64 or iso8601 types unless they have been defined using xmlrpc_set_type().
For iso8601 type it returns "datetime".
Otherwise it returns strings corresponding directly the XML-RPC data types e.g. "struct","int","string","base64" etc.