I've got an array
that holds the results of a mysql query for zipcodes form a certain point around a given radius. If I var_dump
the array it looks like this:
array(7) {
[0]=> array(1) { ["postal_code"]=> string(5) "11510" }
[1]=> array(1) { ["postal_code"]=> string(5) "11518" }
[2]=> array(1) { ["postal_code"]=> string(5) "11520" }
[3]=> array(1) { ["postal_code"]=> string(5) "11558" }
[4]=> array(1) { ["postal_code"]=> string(5) "11563" }
[5]=> array(1) { ["postal_code"]=> string(5) "11570" }
[6]=> array(1) { ["postal_code"]=> string(5) "11572" }
}
I'd like to extract the data and end up with a string of zipcodes with a comma as delimiter (i.e., "11510,11518,11520,11558,11563,11570,11572"
).
What would be the best way to do so?