<?php function Vaildate($str,$flag){ if ($flag == "email"){ return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; } } ?>
info at phpclasses dot org