PHP preg_match - only allow alphanumeric strings and - _ characters


if(preg_match('/[^a-z\s\d]/i', $line)) {
    $size_x -= 15;
}

 

 

Reference:

https://stackoverflow.com/questions/7753365/php-preg-match-only-allow-alphanumeric-strings-and-characters/46413055



Article ID: 27
Created On: Thu, Sep 17, 2020 at 7:12 AM
Last Updated On: Thu, Sep 17, 2020 at 7:12 AM
Authored by: Saeed Nobakht [[email protected]]

Online URL: https://www.navel.ir/article/php-preg_match-only-allow-alphanumeric-strings-and-_-characters-27.html