Comment pouvez-vous convertir le code suivant en PHP?Convertir Python pour -loop en PHP
summat = [sum(arra[i:i+4]) for i in range(0,len(arra),4)]
Ma tentative
$summat = array()
foreach (range(0, $arra.length, 4) as $i) {
$summat = array (array_sum(array_slice($array, $i, $i+5))) // don't know how to append the sums the array