<?php function test($str) { if (ltrim($str, 'A..Za..z0..9.') !== '') { return 'found a bad character'; } else { return 'all good'; } } foreach (['good', 'b@d', '$รท*'] as $s) { printf("%s : %s\n", $s, test($s)); }
You have javascript disabled. You will not be able to edit any code.