In JS I used this code:
if(string.match(/[^A-Za-z0-9]+/))
but I don't know, how to do it in PHP.
Use preg_match().
if (!preg_match('/[^A-Za-z0-9]/', $string)) // '/[^a-zd]/i' should also work. { // string contains only english letters & digits }
1.4m articles
1.4m replys
5 comments
57.0k users