数组拆分array_walk
2024-11-23 18:26:03
$arr = array("2-10","1-5"); array_walk($arr, function($item) use (&$res) { list($f, $n) = explode('-', $item, 2); for ($i = 0; $i < $n; $i++) { $res[] = "$f-1"; } });