codice:
  function addhttp($webpage) {

    $pos = strpos($webpage, 'http://');

    if($pos === false && $webpage!= '') {

      $webpage = "http://".$webpage;

    }

    return $webpage;

  }
potresti aggiungere anche un controllo sintattico sull'indirizzo, per essere sicuro che sia un indirizzo valido con una regex.

ciao