我不能 \\
用\
我使用以下代码替换
$current_relative_path = dirname(__FILE__); // E:\\xampp\\htdocs\\1\\wp-content\\plugins
$result = str_replace("\\\\", "\\", $current_relative_path);
file_put_contents("___test.php",var_export($result, true)."\n<br><br>\n", FILE_APPEND);
我得到这样的输出
E:\'xampp\'htdocs\'1\'wp-content\'plugins
我无法\
在str_replace
函数中运行带有转义的 php 任何我需要输出的想法,例如跟随
E:\xampp\htdocs\1\wp-content\plugins