Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php URL中包含百分比的文件名_Php_Regex_Url - Fatal编程技术网

Php URL中包含百分比的文件名

Php URL中包含百分比的文件名,php,regex,url,Php,Regex,Url,我有一个包含几个PDF的目录,我有一个设置访问路径和其他所有内容的脚本 <a href="<?= get_home_url().'/'.$certificate->file_path.'/'.$certificate->file_name ?>" target="_blank">Baixar</a> 但是,我在包含类型重音符号(逗号和百分比)的文件中出现404错误 带重音的文件: 其他无重音的文件通常会被访问 不带重音的文件: 我已经尝试

我有一个包含几个PDF的目录,我有一个设置访问路径和其他所有内容的脚本

<a href="<?= get_home_url().'/'.$certificate->file_path.'/'.$certificate->file_name ?>" target="_blank">Baixar</a>

但是,我在包含类型重音符号(逗号和百分比)的文件中出现404错误

带重音的文件:

其他无重音的文件通常会被访问

不带重音的文件:


我已经尝试过使用urlencode、htmlentities、hand等函数,但没有得到结果

您应该使用
%25
%
进行编码,因为它是URL中的一个特殊字符。请尝试改用此URL:

http://exodocientifica.com.br//_fispq/ALARANJADO%20DE%20METILA%200,2%25.pdf