Jump to content

Expiration Month and Data Type


doubledee

Recommended Posts

I have a payment form with the following code...

 

					<!-- Expiration Month -->
					<span class="group">
						<label class="innerlabel" for="expMonth">Month</label><!-- -->
						<select id="expMonth" name="expMonth">
							<option></option>
							<option>01</option>
							<option>02</option>
							<option>03</option>
							<option>04</option>
							<option>05</option>
							<option>06</option>
							<option>07</option>
							<option>08</option>
							<option>09</option>
							<option>10</option>
							<option>11</option>
							<option>12</option>
						</select>
					</span>

 

How is that data represented as far as Data-Type?? 

 

Is it treated as a String or an Integer??

 

How can I ensure that when I sent it to the Payment Gateway that it is treated as a Two-Digit value??

 

Thanks,

 

 

 

Debbie

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/232525-expiration-month-and-data-type/
Share on other sites

PHP is loosely typed, meaning that it typecasts on the fly depending on how you are using a variable.  If it's already in a string format, it won't typecast to a numeric form unless you attempt to do arithmetic on it. 

 

You can always use printf() to format a number in a particular manner if you are starting with an integer, and need to add a leading zero.

 

 

PHP is loosely typed, meaning that it typecasts on the fly depending on how you are using a variable.  If it's already in a string format, it won't typecast to a numeric form unless you attempt to do arithmetic on it. 

 

You can always use printf() to format a number in a particular manner if you are starting with an integer, and need to add a leading zero.

 

Well, as you can see, I choose to use leading zeroes, so I guess that means that I will be okay when I send the data over, right?

 

So a "01" should remain a "01" in my XML string, right?

 

 

 

Debbie

 

 

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.