I get a variable $total and $value[1-total] as input. The values will be sets of 3 numbers like $value[1] = 002; $value[2] = 012;...ect.
I need to loop through all the values ($total is total number of values) and delete any duplicate values. Then a new $total_new will be set to the number of values without any duplicates and resort $value from [1-total_new] with the non-duplicate values.
After this I will have a string that holds a number sequence like '001002073012294'.
I need to loop the $total_new with the new values and erase those values in the $string by multiples of 3(ex: extract 000 from 210000 would extract the first 3, but it must extract the last three which is the 2nt set of 3 numbers). I tried to do this with strtok but could not get it to work. Maybe convert the string into an array holding a set of 3 numbers each from the string and then if that value == $value[1-total], make it ''(emtpy) and put the array back into a string.
If anyone knows how to do this please let me know how, I have spents hours on hours trying all kinds of methods and cannot get it to work right. I know it might be asking a lot but I am stuck.
Thank you for your time.
I figured out how to do the top part which seems way to easy compared to the code I was producing.
for($x=1;$x<=$overlap;$x++)
{
$delete[$x] = $_POST['number'.$x];
}
$delete = array_unique($delete);//gets unquie values
$delete = array_reverse($delete);//reset the index to start at 0, then1,2,3ect.
$count = count($delete);//counts have many to delete
I am still working on the last part. I will post resolved if I can get it.