$numbers = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
$characters = array('-', '/', ' ', '#', '.', 'a', 'b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A',
'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z');
$specialchars = array('-', '/', ' ', '#', '.');
$num_pos = $this->strposArr($address, $numbers, 2);
$street_name = substr($address, 0, $num_pos);
$street_name = trim($street_name);
$number_part = substr($address, $num_pos);
$number_part = trim($number_part);
$ext_pos = $this->strposArr($number_part, $characters, 0);
if ($ext_pos != '') {
$house_number = substr($number_part, 0, $ext_pos);
$house_extension = substr($number_part, $ext_pos);
$house_extension = str_replace($specialchars, '', $house_extension);
} else {
$house_number = $number_part;
$house_extension = '';
}
return array($street_name, $house_number, $house_extension);