something simple but cant find the answer :/

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
deathy
Forum Newbie
Posts: 7
Joined: Tue Jun 03, 2003 2:51 pm

something simple but cant find the answer :/

Post by deathy »

how can i change a / to a \ in my php script ?

JynxI
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

[php_man]str_replace[/php_man]
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post 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 \\.
Post Reply