PHP preg_match for only numbers and letters, no special characters

后端 未结 3 1924
[愿得一人]
[愿得一人] 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:49

    If you want to match more than 1, then you'll need to, however, provide us with some code and we can help better.

    although, in the meantime:

    preg_match("/([a-zA-Z0-9])/", $formContent, $result);
    print_r($result);
    

    :)

提交回复
热议问题