Home > Article > Backend Development > Detailed explanation of the use of extension_loaded() function in php
I believe many friends are confused when they see the title. They don’t know much about the usage of php functionextension_loaded(). Today we will introduce to you an example and analyze the function. The specific usage of extension_loaded() to check whether an extension has been loaded, and a supplementary explanation of the method of checking whether the php extension has been loaded on the local machine!
Recommended Manual: php Complete Self-Study Manual
##extension_loaded — Check whether an extension has been loaded
For example:<?php if (!extension_loaded('gd')) { if (!dl('gd.so')) { exit; } } ?>The above code determines whether to load the gd library extension.
Related video recommendations: 1.
Dugu Jiujian(4)_PHP video tutorial
Supplement:
How to check if php has enabled extensions:Command line cmd interface:Input: php -mDisplay results As follows:
[PHP Modules] bcmath bz2 calendar com_dotnet ctype curl date dom filter ftp gd hash iconv json libxml mbstring mcrypt mysql mysqli odbc pcre PDO pdo_mysql PDO_ODBC pdo_sqlite Reflection session SimpleXML sockets SPL SQLite standard tokenizer wddx xml xmlreader xmlwriter Zend Optimizer zip [Zend Modules]
Summary:
This article introduces the php function extension_loaded() in detail through examples Usage, I believe everyone has a certain understanding of this, I hope it will be helpful to your work!The above is the detailed content of Detailed explanation of the use of extension_loaded() function in php. For more information, please follow other related articles on the PHP Chinese website!