Файловый менеджер - Редактировать - /home/kckglobal/public_html/portal/vendor/azjezz/psl/src/Psl/Vec/chunk.php
Назад
<?php declare(strict_types=1); namespace Psl\Vec; /** * Returns a list containing the original list split into chunks of the given * size. * * If the original list doesn't divide evenly, the final chunk will be * smaller. * * @template T * * @param iterable<T> $iterable * @param positive-int $size * * @return list<list<T>> */ function chunk(iterable $iterable, int $size): array { $result = []; $ii = 0; $chunk_number = -1; foreach ($iterable as $value) { if ($ii % $size === 0) { $result[] = []; $chunk_number++; } $result[$chunk_number][] = $value; $ii++; } return values($result); }
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка