php mysqli_set_charset()函数
定义mysqli_set_charset()函数设置默认字符集。 语法PHP mysqli_set_charset()函数具有以下语法。 mysqli_set_charset(connection,charset); 参数参数 是否必须 描述 connection 需要。 MySQL连接使用 charset 需要。 默认字符集 返回值成功时返回TRUE。失败时为FALSE。 实例设置默认字符集 // http://www.manongjc.com/article/1695.html // 作者:脚本之家教程 $con=mysqli_connect("localhost","my_user","my_password","my_db"); if (mysqli_connect_errno($con)){ echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // Change character set to utf8 mysqli_set_charset($con,"utf8"); mysqli_close($con); ?> (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
