我不是一個PHP開發人員。我正在使用谷歌API,我使用的後端是PHP。我正在使用一個返回給定郵政編碼的特定距離內的位置的例子。從PHP返回的結果集的格式如下..循環PHP陣列
Array
(
[0] => Array
(
[id] => 554
[postcode] => 1225
[suburb] => Royal Exchange
[aus_post_name] => ROYAL EXCHANGE
[state] => NSW
[lat] => -33.864393
[lon] => 151.209608
)
[1] => Array
(
[id] => 559
[postcode] => 1230
[suburb] => Queen Victoria Building
[aus_post_name] => QUEEN VICTORIA BUILDING
[state] => NSW
[lat] => -33.872049
[lon] => 151.206428
)
[2] => Array
(
[id] => 714
[postcode] => 2000
[suburb] => Barangaroo
[aus_post_name] => BARANGAROO
[state] => NSW
[lat] => -33.858315
[lon] => 151.203519
)
[3] => Array
(
[id] => 715
[postcode] => 2000
[suburb] => Dawes Point
[aus_post_name] => DAWES POINT
[state] => NSW
[lat] => -33.855601
[lon] => 151.20822
)
我如何在結果集中循環,並獲得價值,例如用於國家和郊區?
顯示一些代碼,如@JackManey所述。 – Cyclone 2012-02-02 03:32:03
沒關係......自己拿到了答案。繼續投票並關閉它.. – DG3 2012-02-02 03:39:01
使用foreach循環 – alecwhardy 2012-02-02 04:33:41