o zaman 2 defa yaparsın hocam
  $y = str_replace("http://www.xxx.com/","",$x);  
  $y=  str_replace("http://xxx.com/","",$y);
gibi ?