str_replace function wont replace string if i use single quotes

Posted by robezy on Stack Overflow See other posts from Stack Overflow or by robezy
Published on 2010-06-02T11:18:51Z Indexed on 2010/06/02 11:23 UTC
Read the original article Hit count: 224

Filed under:
|

I using php's str_replace function to replace some text. Example below.

str_replace("{x+{\$v}}", "{x-{\$v}}", $this->introtext);

str_replace('{x+{\$v}}', '{x-{\$v}}', $this->introtext);

In first case it replace text, but in second case it is not doing so. What is difference between two?

© Stack Overflow or respective owner

Related posts about php

Related posts about str-replace