Home > Backend Development > PHP Tutorial > 编撰给定文件夹路径 自动生成XML文件工具

编撰给定文件夹路径 自动生成XML文件工具

WBOY
Release: 2016-06-13 12:26:24
Original
985 people have browsed it

编写给定文件夹路径 自动生成XML文件工具
编写给一个文件路径,然后读取路径下文件夹和文件名,自动生成XML文件,请问有大神编写过没有 ,求指导
------解决思路----------------------
基础代码

foreach(glob('images/*.*') as $fn) {<br />  $r[] = (object)array('filename' => $fn, 'type' => 'folder', 'folder' => 'site');<br />}<br />print_r($r);
Copy after login
示例结果
Array<br />(<br />    [0] => stdClass Object<br />        (<br />            [filename] => images/000.bmp<br />            [type] => folder<br />            [folder] => site<br />        )<br /><br />    [1] => stdClass Object<br />        (<br />            [filename] => images/0001.bmp<br />            [type] => folder<br />            [folder] => site<br />        )<br /><br />    [2] => stdClass Object<br />        (<br />
Copy after login

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template