Fatal error: Call to undefined function: iconv() in d:\apache\htdocs\test.php on line 2怎么回事?我的PHP是4.3的
需要加载库文件,你看PHP手册上的内容: Note to Windows® Users: In order to enable this module on a Windows® environment, you need to put a DLL file named iconv.dll or iconv-1.3.dll (prior to 4.2.1) which is bundled with the PHP/Win32 binary package into a directory specified by the PATH environment variable or one of the system directories of your Windows® installation. 你在C:\php\extensions下应该有个php_iconv.dll文件,你把它加载进去
iconv
Note to Windows® Users: In order to enable this module on a Windows® environment, you need to put a DLL file named iconv.dll or iconv-1.3.dll (prior to 4.2.1) which is bundled with the PHP/Win32 binary package into a directory specified by the PATH environment variable or one of the system directories of your Windows® installation. 你在C:\php\extensions下应该有个php_iconv.dll文件,你把它加载进去
php4里面都不是缺省安装的.
$utf8str = iconv('gb2312','utf8','发现');
$sql = "INSERT INTO TABLE (NAME) VALUES ('$utf8str')";
mysql_query($sql);
…………
$sql = "SELECT * FROM TABLE";
$result = mysql_query($sql);
$info = mysql_fetch_assoc($result);
echo iconv('utf8','gb2312',$info['NAME']);
……如果按照上面的做法,能够显示出简体中文的“发现”,但是,如果用"big5"代替"gb2312",即
echo icon('utf8','big5',$info['NAME']);
却显示空???在页面上什么都没有。我理解为:两个编码之间可以相互转化,但是多于两个编码之间是不能转化的。
即:GB2312 <-> UTF8 可以;GB2312 -> UTF8 -> BIG5 不可以不知道这样的理解,以及我上面的操作是否正确?望指教,谢谢