PHP 中的字符串格式


string format in php

基本上我想将这个');"字符串断言为变量,但它给出了错误。我正在研究 Netbeans

错误:

Syntax error
unexpected: '"'
after:  String '"');"'
expected:instanceof, as, =>, }, ',', OR, XOR, &&, ?, ;, ||, &&, |, ^, &, ==, !=, ===, !==, <=,   >=, <, >, <<, >>, +, -, *, /, %, '.', ], ), :

喜欢

$my_string = `"ı');""` 

我错过了什么?我认为报价

您需要对字符串中的字符进行转义:

$my_string = "ı');'"";

有了这个:

echo $my_string;

输出:

ı');"

这是解决方案:

$my_string = "ı');'"";

你需要逃离".

你必须转义倒数第二个"

"ı');'""