《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.snjht.com/jiaocheng/2250.html