3
hello, I want to do a calculation like:
I want to distribute for example 6 integers in another 5 numbers starting at 0 with something like this: 2 1 1 1
or for example 3 integers in 5 numbers starting from zero:
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];
?>
Enter the code you have already done to make the question more explicit
– FábioArsénio