in reply to Re^2: zero padding
in thread zero padding
Yea, the question (and it remains so in all of these) is that the first section is at least 1000.
Otherwise it wouldn't really be 8 bytes digits to begin with (not going to argue semantics here).
I kind of assumed that. Otherwise you'll just have to pad both sides and concat or multiply left by 10000, add to right and pad left.
Update: You could just
sprintf( "%08d", $var1*10000+$var2 )
and call it a day, but that's actually slower than any of the others :(