I have a variable which has, let say the value of 1. I want to tack on a zero at the beginning so it has the value of 01. Thanks![]()
I have a variable which has, let say the value of 1. I want to tack on a zero at the beginning so it has the value of 01. Thanks![]()
Note, that will make it a string. If it gets changed back to an integer, the zero will be removed.PHP Code:$var = '0' . $var;
hosdank (08-23-2008)
Yeah, thanks anyway, but I got it by myself... That's the very basics, I don't know how I forgot![]()
More generally, str_pad().
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks