《PHP学习:如何判断php mysqli扩展类是否开启》要点:
本文介绍了PHP学习:如何判断php mysqli扩展类是否开启,希望对您有用。如果有疑问,可以联系我们。
PHP编程如何判断php mysqli扩展类是否开启
PHP编程php判断mysqli扩展类是否开启,源码如下:
PHP编程
<?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编程感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
转载请注明本页网址:
http://www.vephp.com/jiaocheng/2250.html