$doc = new DOMDocument('1.0','utf-8');
$doc->load("config.xml");
$roots=$doc->documentElement;//获取根节点也就是config(仅有一个)
$childs=$roots->childNodes;//获取根节点下所有子节点也就是 db smarty
for($i=0;$ilength;$i++){ //按照根节点下的子节点数量进行循环存入数组
$config_item=$childs->item($i); //具体获得db smarty
$configs[$config_item->nodeName]=array();//将db smarty这两个子节点的名称作为数据存入数组中
$items=$config_item->childNodes; //获得db smarty下的所有子节点
for($j=0;$jlength;$j++){//按照db smarty下所有子节点数进行循环将db smarty下的子节点名与值以二维数组存入
$item=$items->item($j); //通过循环获取每个db smarty 下的子节点
$configs[$config_item->nodeName][$item->nodeName]=$item->nodeValue;
}//二维数组的书写
}
var_dump($configs);

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver Mac version
Visual web development tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

WebStorm Mac version
Useful JavaScript development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment
