Shane Buckley
Shane Buckley

Reputation: 134

How to escape a backslash that is already escaping a single quote in php?

So I have a script that creates a script that can then create another script. See below, I have written (how do I escape this) where I'm not sure what to do.

fwrite($file, ' 

                fwrite($file, \'

                                 fwrite($file, (how do i escape this)\' (how do i escape this)\'

\'
');
fclose;

I really hope that makes sense to someone!

Upvotes: 0

Views: 103

Answers (1)

JamesG
JamesG

Reputation: 1601

To escape a backslash add another one:

echo " Escape \\";

Upvotes: 1

Related Questions