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

别说谁变了你拦得住时间么 提交于 2019-12-11 23:16:01

问题


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!


回答1:


To escape a backslash add another one:

echo " Escape \\";


来源:https://stackoverflow.com/questions/35879708/how-to-escape-a-backslash-that-is-already-escaping-a-single-quote-in-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!