我不是一个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