3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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"; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
aaa<br /> bbb<br /> cccThere are not allowed symbols in the text