如何使用 PHP 批量溢出 10000 条记录


How to spilt the 10000 records in batch using PHP

我需要将 10,000 多条记录拆分为每批 50 条记录。

我有$name_arr[].此数组包含 10,000 多条记录。如何将每个批次将此数组拆分为五十条记录。

我该怎么办。请帮助我。

试试这个:

array_chunk($name_arr, 50);

http://php.net/manual/en/function.array-chunk.php