但是这个插入的数据中是有特殊字符的,插入数据库中变成两条数据了(貌似是换行捣乱),请问给位能否在php服务端进行编码?
注:我用的是ascii这是客户端的规定
回复讨论(解决方案) header(content-type: text/html; charset=utf-8);
mysql_query(set names ascii);
header(content-type: text/html; charset=utf-8);
$string = iconv('ascii', 'utf-8//ignore', $string);
mysql_query(set names utf8);
mysql_query(insert into...);
这是不可能吧?
