Jump to content

Determine if the first character is a 0


treeleaf20

Recommended Posts

All,

I have a zip code and for example the zip code is 01101. How can I determine if the first character in this is a zero?

 

Thanks in advance.

There are a multitude of ways to do this.

 

Another way:

$zip = "01101";
echo $zip[0];

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.