in reply to clever zero _right_ pad?

You can try this:
$var = "0" x 10; $string = "test"; substr($var, -length($string)) = $string;
But that's not much different than what you had.

Oops: You said right, not left. Nevermind.