amfphp 多维数组
在我的 Flex 应用程序中,我有一个二维数组,如下所示:
arr[0][0] = "11";
arr[0][1] = "12";
arr[1][0] = "21";
arr[1][1] = "22";
我正在将此数组发送到我的网络服务:
amfWebService.doSomethingWithThatArray(arr);
我正在使用警报检查函数的结果(作为字符串)。
现在我的问题是:PHP 无法正确识别数组。
为了看看 PHP 收到了什么,我实现了这个:
if(is_array($arr))
if(is_array($arr[0]))
if(is_array($arr[0][0]))
return "this can't be true";
else
return "no 3 dimensions";
else
return "no 2 dimensions";
else
return "no array";
现在你猜怎么着!我的警报显示“这不可能是真的”,这意味着 arr[0][0] 被识别为数组,而不是它应该被识别为“11”。
有人知道这是关于什么的吗?它的 AMFPHP 1.9 和 Flex 3
in my Flex App, I have a 2-dimensional Array, something like this:
arr[0][0] = "11";
arr[0][1] = "12";
arr[1][0] = "21";
arr[1][1] = "22";
I'm sending this array to my webservice:
amfWebService.doSomethingWithThatArray(arr);
I'm checking the result of the function (which is as string) with an Alert.
Now to my problem: PHP somehow does not recognize the array properly.
To see whats arriving at PHP I've implemented this:
if(is_array($arr))
if(is_array($arr[0]))
if(is_array($arr[0][0]))
return "this can't be true";
else
return "no 3 dimensions";
else
return "no 2 dimensions";
else
return "no array";
Now guess what! My Alert shows me "this can't be true", which means that arr[0][0] is recognized as an array and not as "11", which it should.
Anyone has an idea what this is about? Its AMFPHP 1.9 and Flex 3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
print_r()
来显示结构或$arr
。发现此类问题的最方便方法是使用适当的调试器之后。You could have used
print_r()
to display the structure or$arr
. Most convenient way to find such problems - after using a proper debugger.