Hello all, I am using xmlrpc-epi v. 0.51/PHP Version 5.2.8. My problem is really weird. I need return this array (don't ask why, it is just example): Array ( [3387112] => 3387112 [3385570] => 3385570 ) Code (text): here is my PHP code: function foo() { $in = array("3387112","3385570"); $data = array(); foreach($in as $value) { $data[ (string) $value ] = "$value"; } return $data; } Code (text): output is: Array ( [0] => 3387112 [1] => 3385570 ) Code (text): which is wrong. If somebody can help me, how to put INTEGERS as keys in output array, I will be really happy, or give me some help, I am really stuck. I tried double quotes, (string), strval and so on, I can not put any INT in output, I am not sure, if it is error of XMLRPC-EPI or...?
SISKO: Thanks for answer, but it won't help. Are you using XMLRPC in PHP, or you are just guessing ? Also my code is not wrong, tell me why there is [0] and [1] in my output. If you can, try it in XMLRPC (EPI)
its working fine function foo() { $in = array("3387112","3385570"); $data = array(); foreach($in as $value) { $data[ (string) $value ] = "$value"; } return $data; } echo "<pre>"; print_r(foo()); echo "</pre>";
nope, i guessed it XMLRPC was some kind of script for php, my bad...but if this doesn't work like normal php i think you would get more help in the main programming forum
ahh.. i get it.. i thought the function is wrong... hahaha i will replicate the same function in xml-rpc.. sorry bout that
return array($data); might fix it, explicitly returning an array the xml-rpc library should then use a struct tag to transport the array.
I've got a community website powered by elgg (elgg dot org). I want users to be able to register to that community site from a different website. I found a plugin that allows this. But installing the plugin requires knowledge of xml-rpc, which I don't have. Would anyone like to give it a try? PM me with your fee. Cheers.