Page 1 of 1

something simple but cant find the answer :/

Posted: Thu Oct 21, 2004 5:59 pm
by deathy
how can i change a / to a \ in my php script ?

JynxI

Posted: Thu Oct 21, 2004 6:02 pm
by qads
[php_man]str_replace[/php_man]

Posted: Thu Oct 21, 2004 6:05 pm
by kettle_drum

Code: Select all

$string = "////////";
$string = str_replace("/", "\", $string);
echo $string;
The forum doesnt show two \ in the str_replace. You need to use \\.