Revision: 37896
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at December 19, 2010 15:15 by iloveitaly
Initial Code
function getAddress($dbObject) {
$keys = array('address1', 'city', 'providence', 'postal_code');
$values = array();
foreach($keys as $key)
if(!empty($dbObject->$key))
$values[] = $dbObject->$key;
return implode(' ', $values);
}
Initial URL
Initial Description
Useful when used with the google map directions function http://snipplr.com/view/15530/php-create-google-map-directions-link/
Initial Title
Generate Address String from Array / Object
Initial Tags
object, array
Initial Language
PHP