How to validate URL using php

by thulashi 2014-03-04 18:48:18

Use this code to validate your URL.



$webpage = test_input($_POST["website"]);
if (!preg_match("/(?Sad
?:https ?|ftp)://|www.)[-a-z0-9+&@#/%?=~_|!:,.;]*[-a-z0-9+&@#/%=~_|]/i",$web))
{
$websiteErr = "Please Enter Valid URL";
}
2042
like
0
dislike
0
mail
flag

You must LOGIN to add comments