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.
xmlrpc_get_type
(PHP 4 >= 4.1.0, PHP 5)
xmlrpc_get_type — Riceve il tipo di xmlrpc per un valore PHP
Descrizione
Avviso
Questa funzione è SPERIMENTALE. Ovvero, il comportamento di questa funzione, il nome di questa funzione, in definitiva tutto ciò che è documentato qui può cambiare nei futuri rilasci del PHP senza preavviso. Siete avvisati, l'uso di questa funzione è a vostro rischio.
Questa funzione è particolarmente utile per stringhe base64 e datetime.
Elenco dei parametri
-
value -
Il valore di PHP
Valori restituiti
Restituisce il tipo di XML-RPC.
Esempi
Example #1 Esempio del tipo 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
?>
Vedere anche:
- xmlrpc_set_type() - Imposta il tipo di xmlrpc, base64 o datetime, per un valore di stringa PHP
hfuecks at pinkgoblin dot com ¶
10 years ago
