How to validate URL using php
by thulashi[ Edit ] 2014-03-04 18:48:18
Use this code to validate your URL.
$webpage = test_input($_POST["website"]);
if (!preg_match("/(?
?:https ?|ftp)://|www.)[-a-z0-9+&@#/%?=~_|!:,.;]*[-a-z0-9+&@#/%=~_|]/i",$web))
{
$websiteErr = "Please Enter Valid URL";
}