Answers for "webiste url filter with pregx"

PHP
0

webiste url filter with pregx

$url = "https://www.azonedev.com";
    $url_to_main_domain = preg_replace('/(https|http|:|\/\/|www.|\s)/i','',$url);
    $remove_sub_dir_from_url = preg_replace('/(\/).*/','',$url_to_main_domain);
    echo $remove_sub_dir_from_url;
Posted by: Guest on March-14-2021

Browse Popular Code Answers by Language