On my registration page I need to validate the usernames as alphanumeric only, but also with optional underscores. I\'ve come up with this:
function validate
Here's a custom function to validate the string by using the PHP ctype_alnum in conjunction with an array of allowed chars: