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

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

问题描述:

I m trying to delete one image using unlink function.

But path creates error to pass. My syntax is as below.

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

But this will generate error here.

Please help me to solve this. Thanks in advance.

我试图使用unlink函数删除一个图像。 p>

但是路径 创建错误以通过。 我的语法如下。 p>

  unlink('customer \'。$ user_id。“\ book \”。$ id); 
  code>  pre>  
 
 

但这会产生错误。 p>

请帮我解决这个问题。 提前致谢。 p> div>

Try this:

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

Use this (Use Backslash)

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