james_preece2000 Posted December 11, 2006 Share Posted December 11, 2006 I'm having difficulty sending array data over SOAP, I have my SOAP server set up and have been sending data find and dandy and my app is coming along nicely but I've just come across the following anomaly.If I set:$foo[a] = "test"$foo[b] = "test"return $foo;The response at the other end will print_r as:Array( [a] => "test" [b] => "test")This is what I expected. However, if I send:$foo[50] = "test"$foo[99] = "test"It will print_r as:Array( [0] => "test" [1] => "test")The numeric index has been reindexed from zero. However, if I do this:$foo[50] = "test"$foo[99] = "test"$foo[a] = "test"The response is NOT reindexed:Array( [50] => "test" [99] => "test" [a] => "test")No amount of $foo["99"] making it a string type efforts will fix it, all the keys of the array could be stored as an INT then they are not sent and they are re-indexed at the other end.Has anybody seen this problem before? I would like to use the keys to send ID values of users but I cannot if they will be reindexed!Thanks for your time.James Quote Link to comment https://forums.phpfreaks.com/topic/30252-numeric-array-values-reindex-in-soap-response/ Share on other sites More sharing options...
HuggieBear Posted December 12, 2006 Share Posted December 12, 2006 Is this PHP5? I'm not having any issues with PHP4.3I get exactly the response you'd expect.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/30252-numeric-array-values-reindex-in-soap-response/#findComment-139590 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.