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

// CHECK FOR HTTP:// in address and SET HTTP:// to be added or not accordingly
// *** WEBSITE ***
$poswebsite = strpos($website,$needle);
if($poswebsite == false) {
 // http:// NOT found in website
else {
 // http:// found in website
// *** FACEBOOK ***
$posfacebook = strpos($facebook,$needle);
if($posfacebook == false) {
 // http:// NOT found in facebook
else {
 // http:// found in facebook
// *** TWITTER ***
$postwitter = strpos($twitter,$needle);
if($postwitter == false) {
 // http:// NOT found in twitter
else {
 // http:// found in twitter

<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.