Get php object values into array
Thanks for reading.
I want what is output from the initial echo $zip to be stuffed into an
array as a simple integer stack... i've tried [],{} and a variety of other
accessors... Thanks again!
I have:
$userZip = new ZipCode($userZip); $theZips = array();
foreach ($userZip->getZipsInRange(0, 10) as $miles => $zip) {
echo $zip . '
';
$theZips = $zip;
}
print_r($theZips);
// print_r($theZips) output: ZipCode Object (
[zip_code_id:ZipCode:private] => 33816 [zip_code:ZipCode:private] => 21115
[lat:ZipCode:private] => 42.48 [lon:ZipCode:private] => -83.02
[city:ZipCode:private] => CENTER Ville [county:ZipCode:private] =>
[area_code:ZipCode:private] => [time_zone:ZipCode:private] =>
[state_prefix:ZipCode:private] => VA [state_name:ZipCode:private] =>
[mysql_table] => zip_code [mysql_conn] => [mysql_row:ZipCode:private] =>
Array ( [miles] => 8.88798662376604 [zip_code_id] => 33816 [zip_code] =>
21119 [city] => City [state_prefix] => VA [lat] => 42.48 [lon] => -83.02 )
[print_name:ZipCode:private] => 48015 [location_type:ZipCode:private] =>
[miles] => 8.88798662376604 )
No comments:
Post a Comment