Question: I want to search the foullowing a

```
<style type='text/css\'> 

```

and replace it with `'text/css'`

i am using 

```
$filenew = str_replace("'text/css\'" , "'text/css'", $filenew);

```

But it isn't working, How shall i make it to work ? 

How do you use an escape character. is there some application that generates the code like this ?

Answer: 
A `\` is special in a string used for escaping and to define escape sequences. To mean a literal `\` you need to escape it with another `\` that is `\\`.

```
$filenew = str_replace("'text/css\\'" , "'text/css'", $filenew);
                                 ^^

```
If this is the only possible string that you may be replacing, the code below will work

```
$filenew = str_replace("'text/css\\'" , "'text/css'", $filenew);

```

you have to escape the slash itself.

I strongly suggest that you look closely at text in question to make sure that there are no unwanted replacements.