php
andyzou221312
这个作者很懒,什么都没留下…
展开
-
php和python连接mysql的demo
python: # 需要先安装mysqlclient数据包: # pip install mysqlclient -i https://pypi.tuna.tsinghua.edu.cn/simple import MySQLdb # 打开数据库连接 db = MySQLdb.connect('localhost',user = "root",passwd = "root",db = "test", charset='utf8') # 使用 cursor() 方法创建一个游标对象 cursor c原创 2021-02-11 11:57:31 · 239 阅读 · 1 评论 -
php检测并且转换编码为utf-8
$encode=mb_detect_encoding($str,array("ASCII",'UTF-8',"GB2312","GBK",'BIG5')); $str=mb_convert_encoding($str,'UTF-8',$encode);原创 2020-07-16 16:06:01 · 669 阅读 · 0 评论