Getting domain name without TLD

前端 未结 4 1104
轻奢々
轻奢々 2020-12-21 07:12

I have this code right here:

    // get host name from URL
    preg_match(\'@^(?:http://)?([^/]+)@i\',
    \"http://www.joomla.subdomain.php.net/index.html\"         


        
4条回答
  •  攒了一身酷
    2020-12-21 07:18

    Group the first part of your 2nd regex into /([^.]+)\.[^.]+$/ and $matches[1] will be php

提交回复
热议问题