preg_match exact match code example
Example: preg_match
if(!preg_match('/^\[a-zA-Z]+$/',$input)) {
// String contains not allowed characters ...
}
if(!preg_match('/^\[a-zA-Z]+$/',$input)) {
// String contains not allowed characters ...
}