php vraag
Geplaatst: 19 nov 2004, 21:16
Hoe kan je automatisch http:// toevoegen voor www als http:// niet is teogevoegd?
Code: Selecteer alles
//
// Check if http:// is added with the url, if not -> now it is
//
if(substr($sGBurl,0,7) != 'http://')
{
$sGBurl = 'http://'.$sGBurl;
}
Code: Selecteer alles
preg_replace('/[^(http:\/\/)]www\./i', '\\1 http://www.', $str);