All pastes #925217 Raw Edit

fris

public text v1 · immutable
·published 2008-03-02 03:52 UTC
rendered paste body
<?
//$host = $_SERVER['HTTP_HOST']; need to match www.domain.com

$host = "http://www.domain.com";
if (preg_match("/^https?:\/\/.*?([^\.]+)\.(com|net|org|co\.uk|info|us\.com)/", $host, $matches) ){
$len = intval(strlen($matches[1])/2);
$first_half = substr($matches[1],0,$len);
$second_half = substr($matches[1],$len);
echo "$first_half &nbsp;&nbsp; $second_half";
}
?>