如何判断php mysqli扩展类是否开启

如何判断php mysqli扩展类是否开启

php判断mysqli扩展类是否开启,源码如下:

<?php /* by */ 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>"; } ?>

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/6eaee01e6a44d304ab469d1658d2c578.html