How To Validate URL with Regular expression

This is very lazy tut, but for beginner is good tut. We are doing each time URL validation for websites. This is very common functionality for any website as well as for developer.
Here we are providing simple Reg expression to validate URL.

$reg_exp = "/^(http(s?):\/\/)?(www\.)+[a-zA-Z0-9\.\-\_]+(\.[a-zA-Z]{2,3})+(\/[a-zA-Z0-9\_\-\s\.\/\?\%\#\&\=]*)?$/";
            if(preg_match($reg_exp, 'url') == False){
            $errors[] = 'URL is not valid.';

Support US!,Subscribe Our Mailing List

Subscribe our newsletter and get awesome free article Updates and Demos.

Recommended For You
phpflow is web programming blog.The Articles and Tutorials focused on PHP Programming, Jquery Example,Jquery Plugin,Jquery Demos,Jquery Website,Web
Send Mail Using Amazon Cloud Server With PHP SMTP

In this tutorial i will describe how to send mail using amazon server with PHP SMTP.The amazon cloud server does...