长话短说,由于 PHP 魔术引号,我的数据中有反斜杠。我已经解决了那里的问题,但现在有一些记录有不必要的反斜杠。
1 | This is an example of \' single, \" double, and \\ backslash (in the messed up records)
2 | This example is how it gets stored now \ backslash ' single " double
Run Code Online (Sandbox Code Playgroud)
当我想输出我的数据时,我需要使用斜杠来解决问题并获得以下输出:
1 | This is an example of ' single, " double, and \ backslash
Run Code Online (Sandbox Code Playgroud)
但是这个是错误的:
2 | This example is how it gets stored now backslash ' single " double
Run Code Online (Sandbox Code Playgroud)
因此,我的 php 中的 stripslashes 删除了一个在技术上不用于转义任何内容的斜线。
我不想使用斜杠,因为我的数据应该像这样干净:
1 | This is an …
Run Code Online (Sandbox Code Playgroud) mysql ×1