CakeFest 2024: The Official CakePHP Conference

xmlrpc_get_type

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

xmlrpc_get_typePHP の値に関する xmlrpc 型を取得する

説明

xmlrpc_get_type(mixed $value): string
警告

この関数は、 実験的 なものです。この関数の動作・ 名前・その他ドキュメントに書かれている事項は、予告なく、将来的な PHP のリリースにおいて変更される可能性があります。 この関数は自己責任で使用してください。

この関数は特に base64 及び datetime 文字列で有用です。

パラメータ

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
?>

参考

  • xmlrpc_set_type() - PHP 文字列型用に xmlrpc 型、base64 または datetime を設定する

add a note

User Contributed Notes 1 note

up
0
hfuecks at pinkgoblin dot com
21 years ago
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.
To Top