Jump to content

Remove dots from dot com's


mkelley

Recommended Posts

I have the code below and it produces

 

<title>M.Kelley</title>
<link rel='stylesheet' href='mkelley.com.css' type='text/css' />

 

<?php

$new_domain = $_SERVER['HTTP_HOST'];
switch ($new_domain){
case "mkelley.com":
	echo "<title>M.Kelley</title>";
	echo "<link rel='stylesheet' href='$new_domain.css' type='text/css' />";
	break;	
case "www.mkelley.com":
	echo "<title>M.Kelley</title>";
	echo "<link rel='stylesheet' href='$new_domain.css' type='text/css' />";
	break;

}


?>

 

I'm very very new to regex, how can I remove the . from domain.com or from www.domain.com ? I'd like it to produce

 

<title>M.Kelley</title>
<link rel='stylesheet' href='mkelleycom.css' type='text/css' />	

Link to comment
https://forums.phpfreaks.com/topic/36724-remove-dots-from-dot-coms/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.