开发者

amfphp multidimensional array

in my Flex App, I have a 2-dimensional Array, something开发者_如何学Go 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


You could have used print_r() to display the structure or $arr. Most convenient way to find such problems - after using a proper debugger.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜