Re: [PHP] Reformatting phone number string from user input

2003-08-14 Thread John W. Holmes
Verdon vaillancourt wrote: I haven't completely decided if it's better to store 1234567890 and format it on retrieval or to format it first and store 123-456-7890. I guess unless I plan to do math or something with the raw data later (not too likely for a phone number), it probably doesn't make muc

Re: [PHP] Reformatting phone number string from user input

2003-08-14 Thread Verdon vaillancourt
Thanks John, That does look a lot tidier. I tried a similar approach early on, but was trying to specifically match '(' and ')' and was running into lots of trouble with my syntax, in specific, properly escaping \( and \) so they were not treated as paranthesis/operators/whatever. This is much sim

Re: [PHP] Reformatting phone number string from user input

2003-08-14 Thread Verdon vaillancourt
Yes, I found some examples in the archives that measured a clean string and formatted it according to whether it found 4 (is an error), 7 (xxx-), 10 (xxx-xxx-) or 11 (x-xxx-xxx-). I'm going to work with this sort of logic and standardize the format (or maybe just the length of string)

Re: [PHP] Reformatting phone number string from user input

2003-08-10 Thread John W. Holmes
Verdon vaillancourt wrote: Hi :) I've been working on reformatting a phone number string from user input via a form field. Ultimately, my goal is to format all phone numbers in the same way regardless of whether a user inputs '(123) 456-7890', '123-456-7890', '123.456.7890', etc. before I insert