无法从postgres数据库中转义斜线

问题描述 投票:-1回答:1

无法从我的Postgresql数据库中转义斜线。

enter image description here

我尝试使用addslashes函数,但是它不起作用。

我需要的值是:\ d9 \ 0f ..依此类推

php postgresql
1个回答
0
投票

通过屏幕截图判断,您在终端中显示了结果,但是在表本身中,斜杠已经像这样转义了:

\\\\d9\\\\0f.. 

所以要获得必要的格式,您只需要删除一个转义的斜线

str_replace("\\\\", "\\", $str)
© www.soinside.com 2019 - 2024. All rights reserved.