PHPMailer\PHPMailer

SMTP::iterateLinesprivateWP 1.0

Method of the class: SMTP{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->iterateLines( $s );
$s(required)
.

SMTP::iterateLines() code WP 7.0

private function iterateLines($s)
{
    $start = 0;
    $length = strlen($s);

    for ($i = 0; $i < $length; $i++) {
        $c = $s[$i];
        if ($c === "\n" || $c === "\r") {
            yield substr($s, $start, $i - $start);
            if ($c === "\r" && $i + 1 < $length && $s[$i + 1] === "\n") {
                $i++;
            }
            $start = $i + 1;
        }
    }

    yield substr($s, $start);
}