• (cs)

    Makes sense to me.  He uses delimiters to test the data effectively field by field and then stores it without delimiters for dialing purposes.  Its not really worth the effort because he doesn't actually report which field is flawed, but I suppose the seed to grow from is definitely there.  Not how I would have done it, but then, I would never have used PHP in the first place.

  • roger (unregistered)

    <FONT size=2>What the hell is wrong with you people? </FONT>

    <FONT size=2>Let's assume you have a single box to enter the phone (not the stupid 3-box scheme, but if you insist on that abomination just do <FONT face="Courier New">$phone = $phone1.$phone2.$phone3 <FONT face="Times New Roman">first</FONT></FONT>)</FONT>

    <FONT face="Courier New" size=2>$phone_is_valid = preg_match("/^\d{10}$/", preg_replace("/\D/", "", $phone));</FONT>

    <FONT size=2>In other words, strip all non-digit chars from the phone field, and if the resulting string isn't a 10-digit string, you have a problem.</FONT>

    <FONT size=2>Gee-fookin'-zus. No wonder sites like this exist.</FONT>

Leave a comment on “Doing The Splits”

Log In or post as a guest

Replying to comment #:

« Return to Article