<?php $tests = ['hi', 'hi<', 'what&now', '', '>', "\t"]; foreach ($tests as $test) { if (!preg_match('~^[^ <>&\t]+$~', $test)) { $test = 'anonymous'; } echo "$test\n"; }
You have javascript disabled. You will not be able to edit any code.