Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用php查找远程网页中所有文件的列表_Php_List_File - Fatal编程技术网

如何使用php查找远程网页中所有文件的列表

如何使用php查找远程网页中所有文件的列表,php,list,file,Php,List,File,我是PHP初学者,我想列出远程网页中使用的所有文件,以及使用PHP在.js和.css文件中使用的所有文件 例如,我想获得在http://sitename.com/gallery.html我需要这样的列表: /css/gallery.css (using in gallery.html) /css/rtl.css (this file imported in gallery.css) /images/bodybg.png (this file imported in gallery.css) /i

我是PHP初学者,我想列出远程网页中使用的所有文件,以及使用PHP在
.js
.css
文件中使用的所有文件

例如,我想获得在
http://sitename.com/gallery.html
我需要这样的列表:

/css/gallery.css (using in gallery.html)
/css/rtl.css (this file imported in gallery.css)
/images/bodybg.png (this file imported in gallery.css)
/images/gallery/image1.jpg (using in gallery.html)
/images/gallery/image2.jpg (using in gallery.html)
...
就像测试网页的结果一样,它列出了网页中使用的所有文件。

PHP中的最佳方法
这种方式将只列出
.css
文件,但我想列出所有文件(css、js、图像、字体、zip等)