介绍
今天就跟大家聊聊有关利用php怎么判断mysqli扩展类是否开启,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。
<>强如何判断php mysqli扩展类是否开启强>
php判断mysqli扩展类是否开启,源码如下:
& lt;及# 63;php/*通过http://www.manongjc.com/article/1206.html */函数mysqlinstalled () { 如果(function_exists (“mysql_connect")) { 返回true; 其他}{ 返回错误; } } 函数mysqliinstalled () { 如果(function_exists (“mysqli_connect")) { 返回true; 其他}{ 返回错误; } } 如果(mysqlinstalled ()) { 回声“& lt; p>安装mysql扩展灵活;/p>“; 其他}{ 回声“& lt; p> mysql扩展没有安装. . & lt;/p>“; } 如果(mysqliinstalled ()) { 回声“& lt; p> mysqli扩展安装灵活;/p>“; 其他}{ 回声“& lt; p> mysqli扩展没有安装. . & lt;/p>“; } ,# 63;在