Mask Input phone number in PHP -


i new php want mask input phone number somehow wouldn't allow javascript or jquery

$_session["oh"]["phone"]=(empty($_session["oh"]["phone"]))?$_cookie["phone"]:$_session["oh"]["phone"]; 

follow kind of patterns mask phone , validate

$pattern = "/^([1]-)?[0-9]{3}-[0-9]{3}-[0-9]{4}$/i" 

reference

afaik , have used mask() jquery helps validate

$("#phone").mask("(999) 999-9999"); 

its handy use


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

java - SmsManager sending message more than one -