Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

change type

General discussions related to php

Moderators: macek, egami, gesf

change type

Postby frogrocker » Sun Jul 13, 2003 10:58 am

is it possible to change an interger to have a certain amount of numbers in it

e.g
can i change 7 to 07
keep 12 as 12
change 5 to 05
etc.

TIA
User avatar
frogrocker
New php-forum User
New php-forum User
 
Posts: 98
Joined: Mon Jul 07, 2003 10:30 pm
Location: Manchester

Postby bezmond » Sun Jul 13, 2003 2:01 pm

User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK

Postby swirlee » Sun Jul 13, 2003 6:55 pm

The "right" way to do this is to use sprintf() or str_pad(). They're both pretty straight-forward, just read the docs.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back


Return to PHP General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron