0
我使用URL参数在PHP中构建filebrowser,并遇到一些特殊字符问题。 我设法翻译成ß
和%26
到'
和%2C
预期我的节奏蓝调文件夹输出R%2 CN%2CB但PHP说PHP URL GET字符集问题
警告:执行opendir(DIR // MUSIK/R,N ,B /,dir // Musik/R,n,B /)[function.opendir]:Das System can an diegegebene Datei nicht finden。 (代码:2)
我的代码片段:
function fileBrowser($dir, $file) {
$trans = array("&" => "%26","'" => "%2C");
$cdir = strtr(@$_GET['dir'],$trans);
$cfile = strtr($file,$trans);
...
能否请你给我一个提示?
有['urlencode()来'](http://php.net/urlencode),选择那些。但是,您现在是否生成一个URL,或者您是否尝试使用PHP文件功能访问它? (如果是这样,则不需要URL编码。) – mario
谢谢,但现在我的问题得到了解答。 – Manticore
谷歌“php unicode文件名”,你会得到一些有趣的结果。 – inhan