Open ejacky opened 4 years ago
PHP7 中解析 strlen('\n') 是双字节的, strlen("\n") 是单字节的
$t = '{"a":"\u003c1\n"}'; $t1 = json_decode($t, true); dump(strlen($t1['a']));
json_decode 会解析 “\u003c1” 为 “<” , 将 \n 解析为 ‘\n’
PHP7 中解析 strlen('\n') 是双字节的, strlen("\n") 是单字节的