如何判斷php mysqli擴(kuò)展類是否開啟
更新時(shí)間:2016年12月24日 08:57:30 投稿:lqh
php高級版本都支持mysqli擴(kuò)展類,但是默認(rèn)情況下,mysqli擴(kuò)展類是沒有開啟的,本文章向大家介紹php如何判斷mysqli擴(kuò)展類是否開啟,需要的朋友可以參考一下
如何判斷php mysqli擴(kuò)展類是否開啟
php判斷mysqli擴(kuò)展類是否開啟,源碼如下:
<?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)文章
thinkPHP基于反射實(shí)現(xiàn)鉤子的方法分析
這篇文章主要介紹了thinkPHP基于反射實(shí)現(xiàn)鉤子的方法,結(jié)合實(shí)例形式分析了php基于系統(tǒng)自帶的ReflectionClass、ReflectionMethod 類與函數(shù)實(shí)現(xiàn)鉤子功能的相關(guān)操作技巧,需要的朋友可以參考下2017-11-11php 微信公眾平臺開發(fā)模式實(shí)現(xiàn)多客服的實(shí)例代碼
這篇文章主要介紹了php 微信公眾平臺開發(fā)模式實(shí)現(xiàn)多客服的實(shí)例代碼的相關(guān)資料,需要的朋友可以參考下2016-11-11YII2框架中使用yii.js實(shí)現(xiàn)的post請求
本文給大家介紹的是簡單分析下用yii2的yii\helpers\Html類和yii.js實(shí)現(xiàn)的post請求的方法,非常的簡單,有需要的小伙伴可以參考下2017-04-04