Results 1 to 2 of 2
May 9, 2007, 09:25 #1
- Join Date
- Jul 2005
- 0 Post(s)
- 0 Thread(s)
How do I combine the data of 2 variables and assign it to a new one?
I wish to find out how to combine the data of 2 variables, as well as add a character in between, then assign this new data to a new variable.
An example would be for credit card processing, when the merchant wants the form field results of a month and a year to form an expiration date.
Here is my code;
$expiration = "".$expMonth."/".$expYear."";
$c = isset($c) ? $c : '';
$c = new CCValidate;
$c = $c->validate_card($cardType, $acct, $expiration) ? 'VALID' : 'NOT VALID';
I am trying to output this;
assign it to the $expiration variable and then pass it to my class. Thanks so much!
May 9, 2007, 10:30 #2PHP Code:
$expiration = $expMonth."/".$expYear;
Instead of passing $expiration to your class, just 'echo $expiration;' to see what it outputs.. should output 00/00 or whatever the values of $expMonth and $expYear.- the lid is off the maple syrup again!