public static function splitAddress($strAddress)
    {
        $strAddress = trim($strAddress);

        $a = preg_split(
            '/(\\s+)(\d+)/',
            $strAddress,
            2,
            PREG_SPLIT_DELIM_CAPTURE
        );
        $strStreetName = trim(array_shift($a));
        $strStreetNumber = trim(implode('', $a));

        if (empty($strStreetName) || empty($strStreetNumber)) { // American address notation
            $a = preg_split(
                '/([a-zA-Z]{2,})/',
                $strAddress,
                2,
                PREG_SPLIT_DELIM_CAPTURE
            );

            $strStreetNumber = trim(array_shift($a));
            $strStreetName = implode('', $a);
        }

        return array($strStreetName, substr($strStreetNumber, 0, 45));
    }
public static function splitAddress($strAddress)
    {
        $strAddress = trim($strAddress);

        $a = preg_split(
            '/(\\s+)(\d+)/',
            $strAddress,
            2,
            PREG_SPLIT_DELIM_CAPTURE
        );
        $strStreetName = trim(array_shift($a));
        $strStreetNumber = trim(implode('', $a));

        if (empty($strStreetName) || empty($strStreetNumber)) { // American address notation
            $a = preg_split(
                '/([a-zA-Z]{2,})/',
                $strAddress,
                2,
                PREG_SPLIT_DELIM_CAPTURE
            );

            $strStreetNumber = trim(array_shift($a));
            $strStreetName = implode('', $a);
        }

        return array($strStreetName, substr($strStreetNumber, 0, 45));
    }
public static function splitAddress ( $ strAddress ) { $ strAddress = trim ( $ strAddress ) ; $ a = preg_split ( '/(\\s+)(\d+)/' , $ strAddress , 2 , PREG_SPLIT_DELIM_CAPTURE ) ; $ strStreetName = trim ( array_shift ( $ a ) ) ; $ strStreetNumber = trim ( implode ( '' , $ a ) ) ; if ( empty ( $ strStreetName ) || empty ( $ strStreetNumber ) ) { // American address notation $ a = preg_split ( '/([a-zA-Z]{2,})/' , $ strAddress , 2 , PREG_SPLIT_DELIM_CAPTURE ) ; $ strStreetNumber = trim ( array_shift ( $ a ) ) ; $ strStreetName = implode ( '' , $ a ) ; } return array ( $ strStreetName , substr ( $ strStreetNumber , 0 , 45 ) ) ; }
Try to split an address into street and housenumber
This is not guaranteed to always return a correct answer

@param string $strAddress
@return array
Try to split an address into street and housenumber This is not guaranteed to always return a correct answer