[英]how to use single quote inside double quote while double quote already inside single quote?
我有字符串$html = ' <button onclick="js_func(this, "in this point")"> submit </button>'
我想将字符串发送给我正在尝试使用'/'' string '\\'
js函数'/'' string '\\'
也带有"/"" string "\\"
但尚未得到解决方案。请为我提供正确的解决方案。
只需使用反斜杠将其转义,就像这样简单:
$html = ' <button onclick="js_func(this, \'in this point\')"> submit </button>'
使用\\
==>'<按钮onclick =“ js_func(this,\\”在这一点\\“)”>提交</ button>'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.