$url=$_GET['url']; echo preg_replace("#\\\#ui","/",$url);// use three echo '<br>or<br>'; echo str_replace("\\","/",$url); //use double