-
- function is_valid_url($url){
- $p1 ='/(http|https|ftp):\/\/[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(\/.*)?$/i';
- return preg_match($p1, $url);
- }
-
- function is_valid_email($email){
- if (filter_var($email, FILTER_VALIDATE_EMAIL))
- return true;
- else
- return false;
- }
-
- function is_valid_ip($ip){
- if (filter_var($ip, FILTER_VALIDATE_IP))
- return true;
- else
- return false;
- }
-
- ?>
复制代码
|