-3

テキストボックスへのユーザー入力に特殊文字が含まれていないことを確認したい。javascript/Jqueryを使用せずにテキストボックスを検証するにはどうすればよいですか

4

1 に答える 1

1

これを試してください$name、ユーザー入力です、

if(preg_match('/[^a-z0-9 _]+/i', $name)) {
// preg_match will return true if it finds 
// a character *other than* a-z, 0-9, space and _
// *anywhere* inside the string
}
于 2013-09-20T06:08:49.677 に答える