Generate Address String from Array / Object
Useful when used with the google map directions function http://snipplr.com/view/15530/php-create-google-map-directions-link/
Copy this code and paste it in your HTML
function getAddress($dbObject) {
$keys = array('address1', 'city', 'providence', 'postal_code');
foreach($keys as $key)
if(!empty($dbObject->$key)) $values[] = $dbObject->$key;
}
Report this snippet
Comments
Subscribe to comments