📜  php 将数组分成两半 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:56.447000             🧑  作者: Mango

代码示例2
$alphabet = array("a", "b", "c", "d", "e","f");

$firsthalf = array_slice($alphabet, 0, count($alphabet) / 2);
$secondhalf = array_slice($alphabet, count($alphabet) / 2);