PHP – Regex: Check If String Contains Character Other Than A-Z


if (preg_match (‘/[^a-z]/i’, $string_to_check)) {
// The string contains characters other than a-z and A-Z
}

Advertisements