B-219 Sec-55 Noida, India
+918010221733

How to add http:// if it is not in the URL?

Use the below given function for it

function addhttp($url) {
if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
$url
= "http://" . $url;
}
return $url;
}
(Visited 39 times, 1 visits today)

Leave a reply