/ Published in: PHP
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"; ?>