For MediaWiki (recent comments | status changes | tags | authors | states | release notes | statistics)
Looks ok... :D
What if the padding character in padleft or padright is an HTML character code? In particular, it sure would be useful if it could be (or include) an (which should count as one character). Could we get this effect by judicious application of something like html_entity_decode() to the padding string, before measuring it?
Would be sensible. Patches are welcome, post them on Bugzilla if you'd like.