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