PHP preg_match for only numbers and letters, no special characters

后端 未结 3 1962
[愿得一人]
[愿得一人] 2021-02-06 04:04

I don\'t want preg_match_all ... because the form field only allows for numbers and letters... just wondering what the right syntax is...

Nothing fancy ... just need to

3条回答
  •  北荒
    北荒 (楼主)
    2021-02-06 04:46

    if(preg_match("/[A-Za-z0-9]+/", $content) == TRUE){
    
    } else {
    
    }
    

提交回复
热议问题