Dreamweaver
<code>{<span>dede:</span>geturl runphp=<span>'yes'</span>} <span>$url</span> = <span>$_SERVER</span>[<span>'HTTP_HOST'</span>]; preg_match(<span>"#[\w-]+\.(com|net|org|gov|cc|biz|info|cn|co)(\.(cn|hk|uk))*#"</span>, <span>$url</span>, <span>$match</span>); <span>@me</span> = <span>$match</span>[<span>0</span>]; {<span>/dede:geturl}</span></code>
PHP
<code><span><span><?php</span><span>$url</span> = <span>$_SERVER</span>[<span>'HTTP_HOST'</span>]; preg_match(<span>"#[\w-]+\.(com|net|org|gov|cc|biz|info|cn|co)(\.(cn|hk|uk))*#"</span>, <span>$url</span>, <span>$match</span>); <span>echo</span><span>$match</span>[<span>0</span>]; <span>?></span></span></code>
The above introduces PHP and Dreamweaver regular preg_match to obtain the top-level domain name, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.