Jump to content

validating numbers


l0ve2hat3

Recommended Posts

i just want to know the string to use to determin numbers and - only... no specific order...

 

123-123-1234 is valid

12-1234-4561 is valid

111111111 is vaild

 

(454) 456-4564 is NOT valid

cell- 212-4564-4564 is NOT valid

-------- is NOT valid

 

this is what i came up with, but it doesnt work

$test="/(\d+\-?)/"

 

Please help...

Link to comment
https://forums.phpfreaks.com/topic/123753-validating-numbers/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.