php basename 获取文件名,特殊符号的话会有乱码!

WBOY
Release: 2016-06-06 20:11:26
Original
1723 people have browsed it

<code>$url="http://down.99i.Cc:54109/www.xubo.cc/天堂口/【久久爱影院www.xubo.cc】天堂口HD国语中字1024x576版.rmvb";
$name=basename($url);
//输出的结果如下:
string '��久久爱影院www.xubo.cc】天堂口HD国语中字1024x576版.rmvb' (length=70)</code>
Copy after login
Copy after login

有乱码出现应该怎么解?

回复内容:

<code>$url="http://down.99i.Cc:54109/www.xubo.cc/天堂口/【久久爱影院www.xubo.cc】天堂口HD国语中字1024x576版.rmvb";
$name=basename($url);
//输出的结果如下:
string '��久久爱影院www.xubo.cc】天堂口HD国语中字1024x576版.rmvb' (length=70)</code>
Copy after login
Copy after login

有乱码出现应该怎么解?

设置编码 utf-8看看

<code>header("Content-type: text/html; charset=utf-8");</code>
Copy after login
Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template