Hello, I want to do a type calculation:
I want to distribute for example 6 integers into 5 other numbers starting at 0 getting more or less like this: 2 1 1 1 1
or for example 3 integers in 5 numbers that start counting from zero:
1 1 1 0 0
My progress was something like:
<?php
$t = 5;
$i = 0;
$b = 0;
$numeros = array (
0,0,0,0
);
for($i; $i <= count($numeros)-1; $i++):
for($b = $numeros[$i]; $b <= count($numeros)-1; $numeros[$i]++):
$t--;
endfor;
endfor;
echo "<br />";
echo $numeros[0];
?>