I am an IT-consultant, teaching individuals how to work securely on a computer, protect data with encryption tools and how to communicate securely with people over insecure networks. Contact me to make an appointment.
Friday, April 2, 2010
PHP function to check for invalid characters
function isValid($str) { return !preg_match('/[^A-Za-z0-9.#\\-$]/', $str); }
If you also want to include a space, then add \s so in this example:
function isValid($str) { return !preg_match('/[^A-Z\sa-z0-9.#\\-$]/', $str); }