我的本地主机中有filemanager。我正在尝试制作面包屑,并使用PHP中的rawurlencode函数对西里尔字母进行编码。效果很好,但是Chrome会自动在URL中解码。但是,filemanager不适用于西里尔字母,给出错误“路径错误”。示例代码:http://main.xfiddle.com/code_22714833.php
$path = [
0 => 'file',
1 => 'кириллица' // cyrillic word
];
$string = 'Home / ';
$temppath = '';
foreach($path as $temp) {
$temppath .= $temp.'/';
echo htmlentities(rawurlencode($temppath)).' - I need like this<br/><br/>';
$string .= '<a href="?path='.htmlentities(rawurlencode($temppath)).'">'.$temp.'</a> / ';
}
echo 'But Chrome decode URL to this: <b>?path=file%2Fкириллица2F</b><br/>';
echo $string;