如何判断php mysqli扩展类是否开启
php判断mysqli扩展类是否开启,源码如下:
<?php
/* by http://www.manongjc.com/article/1206.html */
function mysqlinstalled (){
if (function_exists ("mysql_connect")){
return true;
} else {
return false;
}
}
function mysqliinstalled (){
if (function_exists ("mysqli_connect")){
return true;
} else {
return false;
}
}
if (mysqlinstalled()){
echo "<p>The mysql extension is installed.</p>";
} else {
echo "<p>The mysql extension is not installed..</p>";
}
if (mysqliinstalled()){
echo "<p>The mysqli extension is installed.</p>";
} else {
echo "<p>The mysqli extension is not installed..</p>";
}
?>
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
您可能感兴趣的文章:php开启mysqli扩展之后如何连接数据库PHP使用mysqli扩展连接MySQL数据库php安装扩展mysqli的实现步骤及报错解决办法PHP mysqli扩展库 预处理技术的使用分析解析在PHP中使用mysqli扩展库对mysql的操作php结合mysql与mysqli扩展处理事务的方法mysqli扩展无法在PHP7下升级问题的解决