how to remove multiple slashes in URI with \'PREG\' or \'HTACCESS\'
site.com/edition/new/// -> site.com/edition/new/
site.com/edition///new/ -> site.co
Edit: Ha I read this question as "without preg" oh well :3
function removeabunchofslashes($url){
$explode = explode('://',$url);
while(strpos($explode[1],'//'))
$explode[1] = str_replace('//','/',$explode[1]);
return implode('://',$explode);
}
echo removeabunchofslashes('http://www.site.com/edition////new///');