Powered by Blogger.

Validate URL in PHP


To validate URL at the server-side use this function.

In this function $variable defines the your string which you want to validate.
$reg_exp = /(http?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \?=.-]*)*\/?$/
ereg($reg_exp,$variable);

No comments