<?php
$not_allowed_symbols = '[^a-z0-9:;,!\'\s*.?()"-]';
//$letter = nl2br("aaa\nbbb\nccc");
//print_r($letter);
if(preg_match("/$not_allowed_symbols/i", $letter)){
echo "There are not allowed symbols in the text";
}else{
echo "There are allowed symbols in the text";
}
Warning: Undefined variable $letter in /in/jV1h1 on line 5
Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /in/jV1h1 on line 5
There are allowed symbols in the text
Output for 8.0.0 - 8.0.30
Warning: Undefined variable $letter in /in/jV1h1 on line 5
There are allowed symbols in the text