Jump to content

[SOLVED] check string


greenba

Recommended Posts

Hello to everyone,

 

I would like to have only number values in a string from 0 to 9. What I use is:

 

if (ereg ("([0-9]{6,13})", $string_one, $regs)) {
    echo "OK";
}

 

but even if the string contains + or / - the validation seems to be OK, but I need it to be OK only when there are just numbers, nothing else.

 

Any ideas?

 

thanx

Link to comment
https://forums.phpfreaks.com/topic/100889-solved-check-string/
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.