如何判斷php mysqli擴展類是否開啟
更新時間:2016年12月24日 08:57:30 投稿:lqh
php高級版本都支持mysqli擴展類,但是默認情況下,mysqli擴展類是沒有開啟的,本文章向大家介紹php如何判斷mysqli擴展類是否開啟,需要的朋友可以參考一下
如何判斷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>";
}
?>
感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
相關(guān)文章
php 微信公眾平臺開發(fā)模式實現(xiàn)多客服的實例代碼
這篇文章主要介紹了php 微信公眾平臺開發(fā)模式實現(xiàn)多客服的實例代碼的相關(guān)資料,需要的朋友可以參考下2016-11-11
YII2框架中使用yii.js實現(xiàn)的post請求
本文給大家介紹的是簡單分析下用yii2的yii\helpers\Html類和yii.js實現(xiàn)的post請求的方法,非常的簡單,有需要的小伙伴可以參考下2017-04-04

