public function parseAddressList($address, array $params = array())
    {
        if ($address instanceof Horde_Mail_Rfc822_List) {
            return $address;
        }

        if (empty($params['limit'])) {
            $params['limit'] = -1;
        }

        $this->_params = array_merge(array(
            'default_domain' => null,
            'validate' => false
        ), $params);

        $this->_listob = empty($this->_params['group'])
            ? new Horde_Mail_Rfc822_List()
            : new Horde_Mail_Rfc822_GroupList();

        if (!is_array($address)) {
            $address = array($address);
        }

        $tmp = array();
        foreach ($address as $val) {
            if ($val instanceof Horde_Mail_Rfc822_Object) {
                $this->_listob->add($val);
            } else {
                $tmp[] = rtrim(trim($val), ',');
            }
        }

        if (!empty($tmp)) {
            $this->_data = implode(',', $tmp);
            $this->_datalen = strlen($this->_data);
            $this->_ptr = 0;

            $this->_parseAddressList();
        }

        $ret = $this->_listob;
        unset($this->_listob);

        return $ret;
    }
public function parseAddressList($address, array $params = array())
    {
        if ($address instanceof Horde_Mail_Rfc822_List) {
            return $address;
        }

        if (empty($params['limit'])) {
            $params['limit'] = -1;
        }

        $this->_params = array_merge(array(
            'default_domain' => null,
            'validate' => false
        ), $params);

        $this->_listob = empty($this->_params['group'])
            ? new Horde_Mail_Rfc822_List()
            : new Horde_Mail_Rfc822_GroupList();

        if (!is_array($address)) {
            $address = array($address);
        }

        $tmp = array();
        foreach ($address as $val) {
            if ($val instanceof Horde_Mail_Rfc822_Object) {
                $this->_listob->add($val);
            } else {
                $tmp[] = rtrim(trim($val), ',');
            }
        }

        if (!empty($tmp)) {
            $this->_data = implode(',', $tmp);
            $this->_datalen = strlen($this->_data);
            $this->_ptr = 0;

            $this->_parseAddressList();
        }

        $ret = $this->_listob;
        unset($this->_listob);

        return $ret;
    }
public function parseAddressList ( $ address , array $ params = array ( ) ) { if ( $ address instanceof Horde_Mail_Rfc822_List ) { return $ address ; } if ( empty ( $ params [ 'limit' ] ) ) { $ params [ 'limit' ] = - 1 ; } $ this -> _params = array_merge ( array ( 'default_domain' => null , 'validate' => false ) , $ params ) ; $ this -> _listob = empty ( $ this -> _params [ 'group' ] ) ? new Horde_Mail_Rfc822_List ( ) : new Horde_Mail_Rfc822_GroupList ( ) ; if ( ! is_array ( $ address ) ) { $ address = array ( $ address ) ; } $ tmp = array ( ) ; foreach ( $ address as $ val ) { if ( $ val instanceof Horde_Mail_Rfc822_Object ) { $ this -> _listob -> add ( $ val ) ; } else { $ tmp [ ] = rtrim ( trim ( $ val ) , ',' ) ; } } if ( ! empty ( $ tmp ) ) { $ this -> _data = implode ( ',' , $ tmp ) ; $ this -> _datalen = strlen ( $ this -> _data ) ; $ this -> _ptr = 0 ; $ this -> _parseAddressList ( ) ; } $ ret = $ this -> _listob ; unset ( $ this -> _listob ) ; return $ ret ; }
Starts the whole process.

@param mixed $address   The address(es) to validate. Either a string,
a Horde_Mail_Rfc822_Object, or an array of
strings and/or Horde_Mail_Rfc822_Objects.
@param array $params    Optional parameters:
- default_domain: (string) Default domain/host.
DEFAULT: None
- group: (boolean) Return a GroupList object instead of a List object?
DEFAULT: false
- limit: (integer) Stop processing after this many addresses.
DEFAULT: No limit (0)
- validate: (mixed) Strict validation of personal part data? If
false, attempts to allow non-ASCII characters and
non-quoted strings in the personal data, and will
silently abort if an unparseable address is found.
If true, does strict RFC 5322 (ASCII-only) parsing. If
'eai' (@since 2.5.0), allows RFC 6532 (EAI/UTF-8)
addresses.
DEFAULT: false

@return Horde_Mail_Rfc822_List  A list object.

@throws Horde_Mail_Exception
Starts the whole process .