/ Published in: PHP
Simple PHP functions to validate url, email address and ip, functions will return TRUE for valid data and FALSE for invalid data.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php function is_valid_url($url){ $p1 ='/(http|https|ftp):\/\/[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(\/.*)?$/i'; } function is_valid_email($email){ return true; else return false; } function is_valid_ip($ip){ return true; else return false; } ?>
URL: http://function-code.blogspot.com/2013/10/url-email-ip-validation-with-php.html