valid chararcters

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all.

I'm writing a form which only these characters are alloved "a-z 0-9 -
what function help me to do this?

really thanx!

Re: valid chararcters

Davide wrote:
Quoted text here. Click to load it

When you've received the data validate it with preg_match, something  
like this (untested):

if( preg_match( '/^[\.a-zA-Z0-9- ]+$/', $value ) === 1 ) {
    // data is valid
else {
    // data is invalid

Site Timeline