$str = "\docs\cheese\dave\aobot"; $new = str_replace('\\', '/', $str); echo $str; echo "
"; echo $new;