I am trying to search for variable sets of numbers in 3. Say for instance my string is: 000011022033040 I have a for loop that loops 2 time with the key (taking set of 3 out) to 000 on the first loop and 022 on the second loop. On each loop I need to delete the key value from the string and put it back together. Also, it can't cut out the 3 if there not in order like 0000 could cut three 0's in two places, that can't happen. The string should end up 011033040.
cancel_$x = a set of 3 numbers
for($x=0;$x<$_POST['overlap'];$x++)
{
$col_c = GetCharInfo('char_sponsor');
if(strtok($col_c['char_sponsor'],$_POST['cancel_'.$x])!='')
{$key = $_POST['cancel_'.$x];
$n1 = strtok($col_c['char_sponsor'],$key);
$n2 = $n1 . substr($col_c['char_sponsor'],strlen($n1)+3,100);
}
I have been messing around with this for hours trying all kinds of diffrent numbers and arrangements but I am unable to get it right. If anyone could steer me in the right direction that would be great, thanks a lot.