For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > March 2006 > Replace a backslash?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Replace a backslash?
no.mail.pls

2006-03-17, 3:55 am

Hi,

How can i replace a backslash character in a string?

The following does not work:
$wd = strtr($wd, "\", " ");

TIA


Capitano Nemo

2006-03-17, 3:55 am

You have to escape the slash character ("\"):
$wd = strtr($wd, "\\", " ");

See PHP Manual: Language Reference / Types / Strings

"no.mail.pls" <no.mail@st.peters> ha scritto nel messaggio
news:441a4f38$0$15795$14726298@news.sunsite.dk...
> Hi,
>
> How can i replace a backslash character in a string?
>
> The following does not work:
> $wd = strtr($wd, "\", " ");
>
> TIA
>
>



no.mail.pls

2006-03-17, 3:55 am

Thanks.

"Capitano Nemo" <nobody@nowhere.nil> wrote in message
news:dvdmu8$2j2l$1@newsreader2.mclink.it...
> You have to escape the slash character ("\"):
> $wd = strtr($wd, "\\", " ");
>
> See PHP Manual: Language Reference / Types / Strings
>
> "no.mail.pls" <no.mail@st.peters> ha scritto nel messaggio
> news:441a4f38$0$15795$14726298@news.sunsite.dk...
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com