新手转码问题
<br />
$url='test.txt';<br />
$read = fopen($url,'r') or die('打开失败');<br />
$text=fread($read,100);<br />
fclose($read);<br />
echo iconv('UTF-8','GBK','这是一个测试').'<br/>';#这句OK<br />
echo iconv('UTF-8','GBK',$text).'<br/>';#这句报错<br />
以上第一个echo正常,第二个echo就老是报以下错误:
Notice: iconv(): Detected an illegal character in input string
test.txt文件为UTF-8格式。
Statement: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