There are a multitude of ways to do this,
this is a simple example but not the most efficent
function strip_down($url)
{
$x = $url;
if(strpos($x,"http://") === 0)
{
$x = substr($x,strlen("http://"));
}
if(strpos($x,"www.") === 0)
{
$x = substr($x,strlen("www."));
}
if(strpos($x,".html") !== 0)
{
$x = substr($x,strpos($x,".html")+5);
}
}
Not checked the above and it's not the best code but it is simple and should give you a basic starter.
Regular expressions would probably be a better solution should you want to look up the manual.