2
我有这样的代码,其中将包括“template.php”文件在这些文件夹中:“content/templates/id1”,“content/templates/id2”,“content/templates/ID3" 等等,等等PHP反向内容添加(排序)
$page_file = basename(__FILE__, ".php");
require("content/" . $page_file . "/content.php");
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($page_path),
RecursiveIteratorIterator::SELF_FIRST);
foreach($iterator as $file) {
if($file->isDir()) {
include strtoupper($file . '/template.php');
}
}
此代码工作得很好,问题是我要反内容增加,这意味着我想先‘内容/模板/ ID9/template.php文件’之前列入“ id8/template.php“等等,直到第一个..
我怎样才能通过修改上面的代码来做到这一点?
你的先生是个天才! :D 非常感谢! – 2010-04-03 15:43:27