Strip http from web adresses - codes not working

Hi Folks,

I have a site where users enter their own details and when they enter their web addresses they sometimes enter the whole address (with http://) and other times just www.
So I wrote soem code I though woudl strip out the http but it doesn;t seem to work.
Can anyone see why

<?php
// CHECK FOR HTTP:// in address and SET HTTP:// to be added or not accordingly
$website=$row_rs_user['website'];
$facebook=$row_rs_user['facebook'];
$twitter=$row_rs_user['twitter'];
$needle="http://";
// *** WEBSITE ***
$poswebsite = strpos($website,$needle);
if($poswebsite == false) {
 // http:// NOT found in website
$webstart=$needle;
}
else {
 // http:// found in website
$webstart="";
}
// *** FACEBOOK ***
$posfacebook = strpos($facebook,$needle);
if($posfacebook == false) {
 // http:// NOT found in facebook
$facebookstart=$needle;
}
else {
 // http:// found in facebook
$facebookstart="";
}
// *** TWITTER ***
$postwitter = strpos($twitter,$needle);
if($postwitter == false) {
 // http:// NOT found in twitter
$twitterstart=$needle;
}
else {
 // http:// found in twitter
$twitterstart="";
}
// SET HTTP:// CODE ENDS ?>

<a href="<?php echo $facebookstart.$row_rs_user['facebook']; ?>">View Facebook Page</a>
<a href="<?php echo $twitterstart.$row_rs_user['twitter']; ?>">View Twitter feed</a>
><a href="<?php echo $webstart.$row_rs_user['website']; ?>">View Website</a>

if you just want to strip out the http:// why don’t you just use str_replace()


<a href="<?php echo str_replace('http://', '', $row_rs_user['website']); ?>">View Website</a>

That works perfectly for them all. Much simpler.
Thanks