的结构,我有以下结构:遍历PHP
Array
(
[signupbasic] => Array
(
[0] => Array
(
[name] => Enter your first name or username
[email] => Enter your email address
[password] => Enter your password
[phone] => Enter your mobile number
[message1] => A text will be send to your phone - reply to validate
[gender] => Array
(
[label] => Gender
[values] => Array
(
[0] => Array
(
[Female] => 1
)
[1] => Array
(
[Male] => 2
)
)
)
[birthday] => Array
(
[label] => Date of birth
[values] => date
)
[message2] => By clicking on "Continue" below you agree to Terms of Service and Privacy Policy
)
)
)
正如你可以看到性别&生日是不同大小的阵列。由于性别和生日的大小不同,我不知道如何穿过上述结构。
任何机构可以帮助我实现这一目标吗?
你用什么代码来解码'JSON'?因为自从5.2版本以来PHP有一个名为'json_decode'的内建函数。看看:http://php.net/manual/en/function.json-decode.php – Kevin 2011-04-28 06:52:01
嗨凯文。我有使用json_decode.My问题是“性别”和“生日”是不同维度的数组,所以我是试图找出如何解析它 – user469999 2011-04-28 06:55:59
我不太清楚我明白你在说什么。什么**是你的问题?为什么你不能遍历对象? – Kevin 2011-04-28 06:58:03