generate functionThu, 10 Nov 2022

strip only host from url and check if exists in array $arr

url = 'http://www.google.com'; arr = ["google.com", "yahoo.com"]; return arr.includes(url.replace(/^(https?:\/\/)?(www\.)?/i, "").split('/')[0])

Javascript
Generate More

Want to kickstart your project?Use the new AI Studio to create your code