It is necessary to remove from the variable all the characters that are there, but leave:
- ordinary letters (a, b, c, d ...)
- @ (dog)
- . (point)
How to do this?
Or make a check. Those. if there is something else there, then do not. Those.
if (preg_match('выражение', $peremennaya)) { выполняем } else { нет }