反斜杠在我的php字符串中无故变成双反斜杠

时间:2020-05-13 19:30:51

标签: php

运行Ubuntu 16.04.6 LTS

PHP 7.3.17

$str = '\controller\welcome';
error_log("string : " . $str);

输出:

\\controller\\welcome

否则在Windows上运行正常。

1 个答案:

答案 0 :(得分:-2)

\是转义字符read more about it here。这是编程101。