Home  >  Article  >  Backend Development  >  How to display extension module files using php

How to display extension module files using php

不言
不言Original
2018-12-25 11:49:233548browse

Although PHP only has basic functions and also contains many modules, its structure allows modules that are used less frequently to be added later without merging. This added module is called an extension module. This article is here Let me introduce to you how to use How to display extension module files using How to display extension module files using php extension module files. Let’s look at the specific content below.

How to display extension module files using How to display extension module files using php

Let’s first take a look at How to display How to display extension module files using How to display extension module files using php extension module files

Use the following command to display the currently available extensions from the command line module.

How to display extension module files using How to display extension module files using php -m

In addition, executing the get_loaded_extensions() function can receive the same content as the array.

Let’s look at specific examples

We use SimpleXMLElement, which is one of the extension modules.

SimpleXMLElement is easy to use. Its usage is the same as other classes, which is to instantiate it and call the method.

The code is as follows

<?How to display extension module files using How to display extension module files using php
$xml = <<<EOT
<meibo>
    <person>
        <name>张三</name>
        <age>29</age>
    </person>
    <person>
        <name>李四</name>
        <age>35</age>
    </person>
    <person>
        <name>王二</name>
        <age>26</age>
    </person>
</meibo>
EOT;

$meibo = new SimpleXMLElement($xml); 

foreach ($meibo as $person) {  
    foreach ($person as $attribute) { 
        echo $attribute->getName(), &#39;:&#39;, $attribute, PHP_EOL;  
    }
    echo PHP_EOL; 
}

The results of running the above code are as follows:

How to display extension module files using How to display extension module files using php

This article ends here , friends who need more exciting content can pay attention to the relevant course columns of the How to display extension module files using How to display extension module files using php Chinese website for further study! ! !

The above is the detailed content of How to display extension module files using php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn