[removed] A BackSlash as part of the string

后端 未结 3 832
无人及你
无人及你 2020-11-27 08:17

I have a JavaScript variable that I echo out using PHP which is shown like this in the page source:

var db_1 = \'C:\\this\\path\';

When I s

3条回答
  •  Happy的楠姐
    2020-11-27 08:37

    You can use:

    echo json_encode('C:\this\path');
    

    json_encode can be used as a filter function for some JavaScript code.

提交回复
热议问题