Combining $_POST Data
Posted: Sat Feb 24, 2007 1:36 am
I have 3 input fields on a page for a phone number, one for area code, one for the first three digits, and one for the last for. I'm trying to combine these into a variable that would hold this: (area) first 3-last 4
I'm using this but it isn't functioning the way I'd hope it would:
Understandably, it adds up all of the values, but I was wonder if there was a way to make it look like this:
(123) 456-7890
Thanks in advance.
I'm using this but it isn't functioning the way I'd hope it would:
Code: Select all
$phone='(' + $_POST['areacode'] + ')' + ' ' + $_POST['phone1'] + '-' + $_POST['phone2'];(123) 456-7890
Thanks in advance.