Horde_Imap_Client_Ids::split PHP Method

split() public method

Split the sequence string at an approximate length.
Since: 2.7.0
public split ( integer $length ) : array
$length integer Length to split.
return array A list containing individual sequence strings.
    public function split($length)
    {
        $id = new Horde_Stream_Temp();
        $id->add($this->tostring_sort, true);
        $out = array();
        do {
            $out[] = $id->substring(0, $length) . $id->getToChar(',');
        } while (!$id->eof());
        return $out;
    }

Usage Example

Ejemplo n.º 1
0
 public function testSplitOnAll()
 {
     $ids = new Horde_Imap_Client_Ids(Horde_Imap_Client_Ids::ALL);
     $this->assertEquals(array('1:*'), $ids->split(2000));
 }