如何在字符串末尾传递BackSlash?

时间:2014-03-24 05:01:07

标签: php

我试图使用取消链接功能删除一个图像。

但是路径会产生错误。我的语法如下。

unlink('customer\'.$user_id."\book\".$id);

但这会产生错误。

请帮我解决这个问题。提前谢谢。

2 个答案:

答案 0 :(得分:1)

试试这个:

unlink('customer\\'.$user_id."\\book\\".$id);

答案 1 :(得分:0)

使用此(使用反斜杠)

unlink("customer/".$user_id."/book/".$id)