SyntaxFix
Write A Post
Hire A Developer
Questions
Use this code is whork :
if (!preg_match('#^http(s)?://#', $url)) { $url = 'http://' . $url; } $urlParts = parse_url($url); $url = preg_replace('/^www\./', '', $urlParts['host']);