Home > Backend Development > PHP Tutorial > php中关于codeigniter的xmlrpc的类在进行数据交换时的类型问题_PHP

php中关于codeigniter的xmlrpc的类在进行数据交换时的类型问题_PHP

WBOY
Release: 2016-06-01 12:16:08
Original
1188 people have browsed it

CI框架

客户端发送的请求类似这样
复制代码 代码如下:
$request = array('parameters00','parameters01');

在客户端的请求你可以制定参数的数据类型,你可以将每个参数单独的放进一个数组,在数组的第二个位置制定参数的数据类型,类似这样
复制代码 代码如下:
$request = array(
array('parameters00','string'),
array('parameters01','boolean'),
array('parameters02','struct'),
array('parameters03','int'),
);

服务端的返回response有一点硬性的要求,必须要格式化数组,并且在response数组中必须只有一个主数组,类似这样:
复制代码 代码如下:
$response = array(
array(parameters00 => array('para00','string'),
parameters01 => array('para01','struct'),
parameters02 => array('para02','boolean'),
),'struct');

如果你要使用关联数组需要注意一下,要注意关联数组的类型制定问题,类似这样:
复制代码 代码如下:
$request = array(
array(
'parameters00' => array(array('paraoo' => 'value'),'struct'),
'parameters01' => array('para01','string'),
),'struct'
);
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template