function squareTrapeze($c){
foreach($new as $keys){
$el['s'] =
};
}
print_r(squareTrapeze($c));
<?php
$in = [1, 2, 3, 4, 5, 6, 7];
$keys = ['a', 'b', 'c'];
$rank = $i = -1;
$new = [];
foreach ( $in AS $a1 )
{
if ( $keys[$i] ?? 0 )
{
$new[$rank][$keys[$i]] = $a1;
}
else
{
$new[++$rank][$keys[$i=0]] = $a1;
}
$i++;
}
print_r ( $new );
function squareTrapeze($c){
foreach($new as $keys);
}
print_r(squareTrapeze($c));
?>