Hi
currently I'm using this bit of code:
$bc= array("#",";","[",".");
$ch= preg_quote(implode('', $bc));
$test=(preg_match('/['.$ch.']/', $name)
This seems to work OK.
But I have 2 slight issues.
- how would I check $name for all characters as above but allow one value from the array $bc to be present at the end of $name ?
eg: $name = test# normally this would match the above. How would I stop it matching the # as the last character ? ( and only # at the end )
- how would I add the following characters to the array / \ * when I've tried they break the preg_match ?
Thanks for your time and help