The type problem in php regarding the xmlrpc class of codeigniter in data exchange

  • 2020-05-09 18:20:26
  • OfStack

The client sends a request like this
 
$request = array('parameters00','parameters01'); 

At the request of the client you can specify the data type of the parameter, you can place each parameter in a separate array, specify the data type of the parameter at the second position of the array, and so on
 
$request = array( 
array('parameters00','string'), 
array('parameters01','boolean'), 
array('parameters02','struct'), 
array('parameters03','int'), 
); 

The server returns response with a 1 point hard requirement that the array must be formatted and that there must be only 1 main array in the response array, like this:
 
$response = array( 
array(parameters00 => array('para00','string'), 
parameters01 => array('para01','struct'), 
parameters02 => array('para02','boolean'), 
),'struct'); 

If you're going to use an associative array and you need to pay attention to 1, you need to pay attention to the type of associative array, something like this:
 
$request = array( 
array( 
'parameters00' => array(array('paraoo' => 'value'),'struct'), 
'parameters01' => array('para01','string'), 
),'struct' 
); 

Related articles: