Create a range of pagination links.

@param  int  $start
@param  int  $end
@return string
551163
public function getPageRange($start, $end)
	{
		$pages = array();

		for ($page = $start; $page <= $end; $page++)
		{
			// If the current page is equal to the page we're iterating on, we will create a
			// disabled link for that page. Otherwise, we can create a typical active one
			// for the link. We will use this implementing class's methods to get HTML.
			if ($this->currentPage == $page)
			{
				$pages[] = $this->getActivePageWrapper($page);
			}
			else
			{
				$pages[] = $this->getLink($page);
			}
		}

		return implode('', $pages);
	}
712848
public function lgetrange($key, $start, $end)
    {
        try {
            return $this->redis->lgetrange($key, $start, $end);
        } catch (\RedisException $e) {
            die("Error!: " . $e->getMessage() . "<br/>");
        }
    }
983245
public function substr(int $start, int $end): string
    {
        return $this->handle->getRange($this->name, $start, $end);
    }
1045124
protected function getVisitorsFilteredByDateRange(Carbon $start, Carbon $end)
    {
        return $this->getCachedVisitors()->filter(function (Visitor $session) use ($start, $end) {
            return $session->updated_at->between($start, $end);
        });
    }
1342971
public function slice(int $start=0, $end=null)
    {
        if ($end === null) {
            $end = $this->length();
        }
        if ($end > 0) {
            $end -= $start;
        } elseif ($end === 0) {
            return new Buffer([]);
        }
        $sliced = array_slice($this->data, $start, $end);
        return new Buffer($sliced);
    }
1000582
public function activeRangesBetween($start, $end)
    {
        $occurrences = array();
        $dh = \Core::make('date');

        $start_date = $this->getStartDate();
        $end_date = $this->getEndDate();
        if (!$end_date) {
            $end_date = $this->getStartDate();
        }

        $repetition_start = (new \DateTime($start_date, $this->getTimezone()))->getTimestamp();
        $repetition_end = (new \DateTime($end_date, $this->getTimezone()))->getTimestamp();
        $repetition_final = null;

        if ($this->getRepeatPeriodEnd()) {
            $repetition_final = (new \DateTime($this->getRepeatPeriodEnd(), $this->getTimezone()))->getTimestamp();
        }

        $repetition_num = $this->getRepeatEveryNum();

        if ($repetition_start > $start) {
            $start = $repetition_start;
        }

        if ($repetition_final && $end > $repetition_final) {
            $end = strtotime('+1 day', $repetition_final);
        }

        if ($start > $end) {
            return $occurrences;
        }

        if (!$this->repeats()) {
            if ($repetition_start >= $start && $repetition_start <= $end) {
                $occurrences[] = array($repetition_start, $repetition_end);
            }
        } else {

            switch ($this->getRepeatPeriod()) {

                case $this::REPEAT_DAILY:
                    $today = floor($start / 86400);
                    $repetition_day = floor($repetition_start / 86400);

                    if ($repetition_day > $today) {
                        $today = $repetition_day;
                    }

                    if ($repetition_difference = ($today - $repetition_day) % $repetition_num) {
                        $today -= $repetition_difference;
                        $today += $repetition_num;
                    }

                    $day_difference = $today - $repetition_day;

                    $current_date = new \DateTime();
                    $current_date->setTimezone($this->getTimezone());
                    $current_date->setTimestamp($repetition_start);
                    $current_date->modify("+{$day_difference} days");
                    $current_date_timestamp = $current_date->getTimestamp();

                    while ($current_date_timestamp < $end) {
                        $occurrences[] = array(
                            $current_date_timestamp,
                            $current_date_timestamp + $repetition_end - $repetition_start
                        );

                        $current_date->modify("+{$repetition_num} days");
                        $current_date_timestamp = $current_date->getTimestamp();
                    }

                    break;

                case $this::REPEAT_WEEKLY:
                    $start_time = new \DateTime();
                    $start_time->setTimezone($this->getTimezone());
                    $start_time->setTimestamp($start);
                    if ($start_time->format('w') != 0) {
                        $start_time->modify('last sunday');
                    }

                    $repetition_start_time = new \DateTime();
                    $repetition_start_time->setTimezone($this->getTimezone());
                    $repetition_start_time->setTimestamp($repetition_start);

                    $diff = $start_time->diff($repetition_start_time);
                    if ($difference = (floor($diff->days / 7) % $repetition_num)) {
                        $interval = \DateInterval::createFromDateString("{$difference} weeks");
                        $start_time->add($interval);
                    }

                    $current_date = new \DateTime(
                        $start_time->format('Y-m-d') . ' ' . $repetition_start_time->format('H:i:s'),
                        $this->getTimezone()
                    );
                    $current_date_timestamp = $current_date->getTimestamp();

                    while ($current_date_timestamp < $end) {
                        foreach ($this->getRepeatPeriodWeekDays() as $day) {

                            $ts = new \DateTime();
                            $ts->setTimestamp($current_date_timestamp);
                            $ts->setTimezone($this->getTimezone());
                            $ts->modify("+{$day} days");
                            $day_of_the_week = $ts->getTimestamp();

                            if ($day_of_the_week >= $start && $day_of_the_week <= $end) {
                                $occurrences[] = array(
                                    $day_of_the_week,
                                    $day_of_the_week + $repetition_end - $repetition_start,
                                );
                            }
                        }

                        $current_date->modify("+{$repetition_num} weeks");
                        $current_date_timestamp = $current_date->getTimestamp();
                    }

                    break;

                case $this::REPEAT_MONTHLY:
                    $start_time = new \DateTime();
                    $start_time->setTimezone($this->getTimezone());
                    $start_time->setTimestamp($start);

                    $start_datetime = new \DateTime($start_time->format('Y-m-01 H:i:s'), $this->getTimezone());
                    $repetition_start_datetime = new \DateTime();
                    $repetition_start_datetime->setTimezone($this->getTimezone());
                    $repetition_start_datetime->setTimestamp($repetition_start);

                    $diff = $repetition_start_datetime->diff($start_datetime);

                    if ($remainder = (($diff->m + ($diff->y * 12)) % $repetition_num)) {
                        $start_datetime->add(\DateInterval::createFromDateString("{$remainder} months"));
                    }

                    $interval = \DateInterval::createFromDateString("{$repetition_num} months");

                    $current_datetime = new \DateTime();
                    $current_datetime->setTimezone($this->getTimezone());
                    $current_datetime->setTimestamp($start_datetime->getTimestamp());

                    switch ($this->getRepeatMonthBy()) {

                        case $this::MONTHLY_REPEAT_WEEKLY:
                            $dotw = $repetition_start_datetime->format('l');
                            $wotm = -1;
                            $month = $repetition_start_datetime->format('m');
                            $wotm_step = $repetition_start_datetime->getTimestamp();

                            do {
                                ++$wotm;
                                $wotm_step = strtotime('-1 week', $wotm_step);
                                $tmp = new \DateTime();
                                $tmp->setTimestamp($wotm_step);
                                $tmp->setTimezone($this->getTimezone());
                                $wotm_step_month = $tmp->format('m');
                            } while ($wotm_step_month === $month);

                            $last_datetime = null;
                            while ($current_datetime->getTimestamp() < $end) {

                                $occurrence_start_date = clone $current_datetime;
                                $occurrence_start_date->setTimezone($this->getTimezone());
                                if ($current_datetime->format('l') != $dotw) {
                                    $occurrence_start_date->modify("next {$dotw}");
                                }

                                $occurrence_start_date->modify("+{$wotm} weeks");

                                $occurrence_start_time = new \DateTime();
                                $occurrence_start_time->setTimestamp($repetition_start);
                                $occurrence_start_time->setTimezone($this->getTimezone());

                                $occurrence_start = new \DateTime(
                                    $occurrence_start_date->format('Y-m-d ') .
                                    $occurrence_start_time->format('H:i:s'),
                                    $this->getTimezone()
                                );

                                $occurrence_start_timestamp = $occurrence_start->getTimestamp();

                                if ($occurrence_start_timestamp >= $start && $occurrence_start_timestamp <= $end) {
                                    if ($occurrence_start->format('m') === $current_datetime->format('m')) {
                                        $occurrences[] = array(
                                            $occurrence_start_timestamp,
                                            $occurrence_start_timestamp + $repetition_end - $repetition_start,
                                        );
                                    }
                                }

                                $last_datetime = clone $current_datetime;
                                $current_datetime->add($interval);
                            }
                            break;

                        case $this::MONTHLY_REPEAT_MONTHLY:
                            $current_datetime = clone $start_datetime;
                            $dotm = $repetition_start_datetime->format('j');
                            $time = $repetition_start_datetime->format('H:i:s');

                            while ($current_datetime->getTimestamp() < $end) {

                                $occurrence_start_date_time = new \DateTime();
                                $occurrence_start_date_time->setTimezone($this->getTimezone());
                                $occurrence_start_date_time->setTimestamp($current_datetime->getTimestamp());
                                $occurrence_start = $occurrence_start_date_time->format("Y-m-{$dotm} {$time}");

                                $occurrence_start = new \DateTime($occurrence_start, $this->getTimezone());
                                $occurrence_start = $occurrence_start->getTimestamp();

                                if ($occurrence_start && $occurrence_start >= $start && $occurrence_start <= $end) {
                                    $occurrences[] = array(
                                        $occurrence_start,
                                        $occurrence_start + $repetition_end - $repetition_start,
                                    );
                                }

                                $current_datetime->add($interval);
                            }
                            break;

                        case $this::MONTHLY_REPEAT_LAST_WEEKDAY:
                            $current_datetime = clone $start_datetime;
                            $weekday = $this->getDayString($this->getRepeatMonthLastWeekday());

                            while ($current_datetime->getTimestamp() < $end) {
                                $occurrence_start = $current_datetime->getTimestamp();

                                $occurrence_start_date_time1 = new \DateTime();
                                $occurrence_start_date_time1->setTimestamp($occurrence_start);
                                $occurrence_start_date_time1->setTimezone($this->getTimezone());
                                $date1 = $occurrence_start_date_time1->format('F Y');

                                $occurrence_start_date_time2 = new \DateTime();
                                $occurrence_start_date_time2->setTimestamp($occurrence_start);
                                $occurrence_start_date_time2->setTimezone($this->getTimezone());
                                $occurrence_start_date_time2->modify('Last ' . $weekday . ' of ' . $date1);

                                $occurrence_start = $occurrence_start_date_time2->format('Y-m-d ') .
                                    $repetition_start_datetime->format('H:i:s');

                                $occurrence_start = new \DateTime($occurrence_start, $this->getTimezone());
                                $occurrence_start = $occurrence_start->getTimestamp();

                                if ($occurrence_start >= $start && $occurrence_start <= $end) {
                                    $occurrences[] = array(
                                        $occurrence_start,
                                        $occurrence_start + $repetition_end - $repetition_start,
                                    );
                                }

                                $last_datetime = clone $current_datetime;
                                $current_datetime->add($interval);
                            }
                            break;
                    }

            }
        }

        return $occurrences;
    }
1329867
public function range()
    {
        $start = $this->page - $this->range;
        $start = ($start < 1) ? 1 : $start;
        $end   = $this->page + $this->range;
        $end   = ($end > $this->pageTotal) ? $this->pageTotal : $end;

        $this->ranges = [
            'start'   => $start,
            'end'     => $end
        ];

        return $this->ranges;
    }
1145008
public function delete($start, $end)
	{
		$start = (int) $start;
		$end   = (int) $end;

		if ($start < 0 || $start >= $this->length() || $end < 0 || $end >= $this->length()) {
			throw new OutOfBoundsException();
		}

		$this->string = mb_substr(
				$this->string,
				0,
				$start,
				$this->encoding
			) .
			mb_substr(
				$this->string,
				$end + 1,
				$this->length(),
				$this->encoding
			);
		return $this;
	}
404609
public function slice($begin, $end = null)
    {
        $array = $this->getArrayCopy();
        $length = $this->length();
        $begin = $begin < 0 ? $length + $begin : $begin;

        if (is_null($end) === true) {
            return new static(array_slice($array, $begin, $length - $begin));
        }

        $end = $end < 0 ? $length + $end : $end;
        $end -= $begin;

        return new static(array_slice($array, $begin, $end));
    }
1140481
public function setLocation(Coordinate $start, Coordinate $end)
    {
        return $this->setStart($start)->setEnd($end);
    }
382904
protected function getStringsBetween($string, $start, $end)
    {

        $pattern = sprintf(
                '/%s(.*?)%s/', preg_quote($start), preg_quote($end)
        );

        preg_match_all($pattern, $string, $matches);

        return $matches[1];
    }
1140899
public function isInRange($start, $end, $byte)
    {
        $range = range($start, $end);

        return in_array(ord($byte), $range);
    }
956847
public function getNextLinks($range = 5)
    {
        $total = $this->getTotalPages();
        $start = $this->getPage() + 1;
        $end = $this->getPage() + $range;
        $last = $this->getLastPage();
        $links = array();
        for ($i = $start; $i < $end; $i++) {
            if ($i > $last) {
                break;
            }
            $links[] = $i;
        }

        return $links;
    }
1215367
public static function abjad($start=0,$end=0){
		$abjadList = [];		
		for($i=65;$i<=90;$i++){
			$abjadList[]=chr($i);
			if($i==90){
				for($j=65;$j<=90;$j++){
					for($k=65;$k<=90;$k++){
						$abjadList[]=chr($j).chr($k);
					}
				}
			}
		}
		
		$abjad = [];
		if($end<$start) $end=$start;
		for($x=$start;$x<=$end;$x++){
			if($x>=702) break;
			$abjad[$x] = $abjadList[$x];
		}
		return $abjad;
	}
62447
private function getPageRange(string $range, int $offset, int $limit)
    {
        $matches = [];

        if (!preg_match('`^([a-zA-Z]+)([0-9]+):?([a-zA-Z]*)([0-9]*)$`', $range, $matches) || count($matches) < 3 || !$matches[1]) {
            throw new ReadRequestFailedException("Could not parse range '$range'");
        }

        $startColumn = $endColumn = $matches[1];
        $startRow = $endRow = (int) $matches[2];

        $startCell = $startColumn.($startRow+$offset);

        if (count($matches) > 4 && $matches[3]) {
            $endColumn = $matches[3];
            $endRow = $matches[4];
        }

        $endCell = $endColumn;

        if ($limit > 0) {
            $endCell .= $endRow+$offset+$limit;
        }

        return "$startCell:$endCell";
    }
371676
protected function buildRangeObject($start, $end)
    {
        return new TimeRange(
                TimeOfDay::fromNative($start),
                TimeOfDay::fromNative($end)
        );
    }
762137
public function setRange(int $start, int $end) : void
    {
        if ($end < $start) {
            throw new InvalidArgumentException('End must be greater or equal to start');
        }

        if ($end === $start) {
            return;
        }

        --$end;

        $firstInt = $start >> 5;
        $lastInt = $end >> 5;

        for ($i = $firstInt; $i <= $lastInt; ++$i) {
            $firstBit = $i > $firstInt ? 0 : $start & 0x1f;
            $lastBit = $i < $lastInt ? 31 : $end & 0x1f;

            if (0 === $firstBit && 31 === $lastBit) {
                $mask = 0x7fffffff;
            } else {
                $mask = 0;

                for ($j = $firstBit; $j < $lastBit; ++$j) {
                    $mask |= 1 << $j;
                }
            }

            $this->bits[$i] = $this->bits[$i] | $mask;
        }
    }