34 lines
701 B
PHP
34 lines
701 B
PHP
<?php
|
|
|
|
class Zend_View_Helper_AddressFormat extends Zend_View_Helper_Abstract {
|
|
|
|
|
|
public function AddressFormat($indirizzo,$cap,$comune,$provincia,$regione){
|
|
|
|
$str = '';
|
|
|
|
if(strlen(trim($indirizzo)) > 0){
|
|
$str.= utf8_encode($indirizzo) . '<br>';
|
|
}
|
|
|
|
if(strlen(trim($comune)) > 0){
|
|
$str .= utf8_encode($comune);
|
|
}
|
|
|
|
if(strlen(trim($cap)) > 0){
|
|
$str .= ' - '.$cap;
|
|
}
|
|
|
|
if(strlen(trim($provincia)) > 0){
|
|
$str .= ' ('.utf8_encode($provincia).')';
|
|
}
|
|
|
|
if(strlen(trim($regione)) > 0){
|
|
$str .= ' - '.utf8_encode($regione);
|
|
}
|
|
|
|
return $str;
|
|
}
|
|
|
|
}
|