generate functionWed, 21 Dec 2022

remove domain from url dynamically

function remove_domain($url) { $domain = str_replace('https://', '', $url); $domain = str_replace('http://', '', $domain); $domain = str_replace('www.', '', $domain); $domain = strstr($domain, '/', true); return $domain; } remove_domain('https://www.google.com/');

Questions about programming?Chat with your personal AI assistant