Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
テキストボックスへのユーザー入力に特殊文字が含まれていないことを確認したい。javascript/Jqueryを使用せずにテキストボックスを検証するにはどうすればよいですか
これを試してください$name、ユーザー入力です、
$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 }