php won't detect all spaces in a string...

Posted by user296516 on Stack Overflow See other posts from Stack Overflow or by user296516
Published on 2010-05-26T07:36:22Z Indexed on 2010/05/26 7:41 UTC
Read the original article Hit count: 146

Filed under:

Hi guys, I've got a string that comes from a POST form where I want to replace all spaced with some other character.

Here's that I did:

$cdata = str_replace(" ","#",$cdata);

And I got this.

--- Contact-ID#=#148 [10274da8]#Sinhronizacija#=#private [1000137d]#Uzvards#=#Zom [1000137c]#Vards#=#Tana [1000130e]#Talrunis#=#3333 [1000130e]#Mobilais#=#5555

As you can see, spaced before "[10..." are still there. Any ideas what could be the problem?

© Stack Overflow or respective owner

Related posts about php