src/Imap.php
public function getUniqueEmails($uid, $body = false)
    {
        Argument::i()
            ->test(1, 'int', 'string', 'array')
            ->test(2, 'bool');

        //if not connected
        if (!$this->socket) {
            //then connect
            $this->connect();
        }

        //if the total in this mailbox is 0
        //it means they probably didn't select a mailbox
        //or the mailbox selected is empty
        if ($this->total == 0) {
            //we might as well return an empty array
            return array();
        }

        //if uid is an array
        if (is_array($uid)) {
            $uid = implode(',', $uid);
        }

        //lets call it
        $items = array('UID', 'FLAGS', 'BODY[HEADER]');

        if ($body) {
            $items = array('UID', 'FLAGS', 'BODY[]');
        }

        $first = is_numeric($uid) ? true : false;

        return $this->getEmailResponse('UID FETCH', array($uid, $this->getList($items)), $first);
    }
public function getUniqueEmails($uid, $body = false)
    {
        Argument::i()
            ->test(1, 'int', 'string', 'array')
            ->test(2, 'bool');

        //if not connected
        if (!$this->socket) {
            //then connect
            $this->connect();
        }

        //if the total in this mailbox is 0
        //it means they probably didn't select a mailbox
        //or the mailbox selected is empty
        if ($this->total == 0) {
            //we might as well return an empty array
            return array();
        }

        //if uid is an array
        if (is_array($uid)) {
            $uid = implode(',', $uid);
        }

        //lets call it
        $items = array('UID', 'FLAGS', 'BODY[HEADER]');

        if ($body) {
            $items = array('UID', 'FLAGS', 'BODY[]');
        }

        $first = is_numeric($uid) ? true : false;

        return $this->getEmailResponse('UID FETCH', array($uid, $this->getList($items)), $first);
    }
public function getUniqueEmails ( $ uid , $ body = false ) { Argument :: i ( ) -> test ( 1 , 'int' , 'string' , 'array' ) -> test ( 2 , 'bool' ) ; //if not connected if ( ! $ this -> socket ) { //then connect $ this -> connect ( ) ; } //if the total in this mailbox is 0 //it means they probably didn't select a mailbox //or the mailbox selected is empty if ( $ this -> total == 0 ) { //we might as well return an empty array return array ( ) ; } //if uid is an array if ( is_array ( $ uid ) ) { $ uid = implode ( ',' , $ uid ) ; } //lets call it $ items = array ( 'UID' , 'FLAGS' , 'BODY[HEADER]' ) ; if ( $ body ) { $ items = array ( 'UID' , 'FLAGS' , 'BODY[]' ) ; } $ first = is_numeric ( $ uid ) ? true : false ; return $ this -> getEmailResponse ( 'UID FETCH' , array ( $ uid , $ this -> getList ( $ items ) ) , $ first ) ; }
Returns a list of emails given a uid or set of uids

@param *number|array $uid  A list of uid/s
@param bool          $body Whether to also include the body

@return array
Returns a list of emails given a uid or set of uids