in reply to Rearranging a string

Does this do what you need?
$string = '0102030405060A0BC'; $fill_char = '0'; if (length($string) % 2 != 0) { $string .= $fill_char; } @bytes = split(//,$string); for ($i=0; $i <= $#bytes; $i+=2) { print $bytes[$i+1]; print $bytes[$i]; } print "\n";
/\/\averick