I want to add an element to an array at random postion using a loop
I have a fixed ranks like the following
$ranks=array("10","9","8","7","6","5","4","3","2","1");
And I have a random rank position according to a chain,
$agent_ranks=array("10","6","2","1");
which are missing indices
I have calculated the difference between the arrays
$arr_diff=array("9","8","7","5","4","3");
Now I want a dynamic array as a result:
$arr_diff_new=array("0","9","8","7","0","5","4","3","0","0");
How can I add value="0" at the missing indices?