的結構,我有以下結構:遍歷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