in reply to (jeffa) Re: Rearranging a string
in thread Rearranging a string

If this is the case, another way of doing it would be:
$s='0102030405060A0BC' # Fix to even number of chars $s.=(length($s)%2?"F":"") for($i=0; $i<length($s); $i+=2) { substr($s,$i,2)=reverse(substr($s,$i,2)); }
jeffa: you were getting empty elements because the two-character pairs are being used as delimiters, with empty elements between them.

--ZZamboni