<?php
echo preg_replace('/[\/]+/', '/', "///a//b/c////d.html");