string assignment

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

string assignment

Post by dude81 »

Hi,
How do I declare string

Code: Select all

$day="00
It assigns it as 0 only.
I need two zeroes there :(
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it'd be your usage that'd make it one zero over two... If you're using it in math, it'll be converted to a number, thus losing the leading zero.
Post Reply