Php 数组到格式化文本键:值
我有这个数组:
Array ( [location] => Array ( [country] => India [country_code] => IN [region] => [region_code] => [city] => [zip] => [latitude] => 13.044468 [longitude] => 77.575665 [ip_address] => 123.236.219.154 [timestamp] => 1317496122 [route] => 3rd Cross Rd [neighborhood] => Basaveshwara Layout [sublocality] => BCITS PVT LTD [locality] => Bengaluru [administrative_area_level_2] => Bengaluru Rural [administrative_area_level_1] => Karnataka ) )
我想知道是否有一种方法可以将其格式化,如下所示:
country: India
country_code:In
就像 键:值
, 键:值
, 键:值
I have this array:
Array ( [location] => Array ( [country] => India [country_code] => IN [region] => [region_code] => [city] => [zip] => [latitude] => 13.044468 [longitude] => 77.575665 [ip_address] => 123.236.219.154 [timestamp] => 1317496122 [route] => 3rd Cross Rd [neighborhood] => Basaveshwara Layout [sublocality] => BCITS PVT LTD [locality] => Bengaluru [administrative_area_level_2] => Bengaluru Rural [administrative_area_level_1] => Karnataka ) )
I wonder if there is a way that I can format it some what like this:
country: India
country_code:In
That is likeKey : Value
,Key : Value
,Key : Value
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
类似的事情?
您必须检查最后一个值并删除“,”。
Something like that?
You have to check the last value and remove the "," then.