Ooh ooh, this one's an easy one!
<?php
$search = "/\/+/";
$replace = '/';
echo preg_replace($search,$replace,'/a//////url//and/shizznit/');
?>
I recommend getting the regex coach. It helped me to learn 😛
The regular expression is a repetition which matches the character '/' as often as possible but at least once.
It even gives little info bits 😛