array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'function.xmlrpc-set-type.php', 1 => 'xmlrpc_set_type', ), 'up' => array ( 0 => 'ref.xmlrpc.php', 1 => 'Funções para XML-RPC', ), 'prev' => array ( 0 => 'function.xmlrpc-server-register-method.php', 1 => 'xmlrpc_server_register_method', ), 'next' => array ( 0 => 'refs.utilspec.windows.php', 1 => 'Extensões Somente para Windows', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/xmlrpc/functions/xmlrpc-set-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_set_type — Sets xmlrpc type, base64 or datetime, for a PHP string value
Sets xmlrpc type, base64 or datetime, for a PHP string value.
Esta função é EXPERIMENTAL. O comportamento desta função, seu nome e documentação poderão mudar sem aviso prévio em futuras versões do PHP. Use por sua conta e risco.
value
Value to set the type
type
'base64' or 'datetime'
Retorna true
em caso de sucesso ou false
em caso de falha.
If successful, value
is converted to an object.
Issues E_WARNING with type unsupported by XMLRPC.
Exemplo #1 A xmlrpc_set_type() example
<?php
$params = date("Ymd\TH:i:s", time());
xmlrpc_set_type($params, 'datetime');
echo xmlrpc_encode($params);
?>
O exemplo acima produzirá algo semelhante a:
<?xml version="1.0" encoding="utf-8"?> <params> <param> <value> <dateTime.iso8601>20090322T23:43:03</dateTime.iso8601> </value> </param> </params>