Just replace print_r($files)
with
foreach ($files as $file) {
include $file;
}
And you should be fine.
문제
To show all files from folder i use this.
<?php
foreach (glob("pardod/*.html") as $filename)
{
include $filename;
}
?>
Yes, its show that what i want but not realy, becouse i need to sort this files to display older to newest.
I found one solutions, but they only works like a echo, but he dont display files like a first code, what is on the top.
$files = glob( 'pardod/*.html' );
array_multisort(
array_map( 'filemtime', $files ),
SORT_NUMERIC,
SORT_DESC,
$files
);
print_r( $files);
(Sory for my bad english)
해결책
Just replace print_r($files)
with
foreach ($files as $file) {
include $file;
}
And you should be fine.
다른 팁
You are looking for something like this:
<?php
$files = array();
$iterator = new DirectoryIterator(dirname(__FILE__));
foreach ($iterator as $fileinfo) {
if ($fileinfo->isFile()) {
$files['name'][] = $fileinfo->getFilename();
$files['edittime'][] = $fileinfo->getMTime();
}
}
array_multisort($files['edittime'],SORT_DESC, $files['name']);
foreach ($files as $file) {
include $file;
};
?>