/ Published in: PHP
![](/img/icon_sav.png?v3)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php // get host name from URL "http://www.php.net/index.html", $matches); $host = $matches[1]; // get last two segments of host name echo "domain name is: {$matches[0]}\n"; ?>
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)