這是我的代碼到目前爲止,現在我想結合這個我能做什麼?如何結合兩個foreach循環合併爲一個
<table>
<tr>
<th>Imported Files</th>
<th>Report Files</th>
</tr>
<?php
$dir = str_replace("/var/www/13_Feb/subscriber-files/","","/var/www/13_Feb/subscriber-files/u*.[cC][sS][vV]");
$dir2 = str_replace("/var/www/13_Feb/subscriber-files/","","/var/www/13_Feb/subscriber-files/r*.[cC][sS][vV]");
foreach(glob($dir) as $file) {
echo "<tr>";
echo "<td>". $file."</td>";
}
foreach(glob($dir2) as $file) {
echo "<td>". $file."</td>";
}
echo "</tr>";
?>
</table>
我想打印這樣
echo "<tr>";
echo "<td>". $file1."</td>";
echo "<td>". $file2."</td>";
}
echo "</tr>";
即在同一個TD我能做些什麼幫助我
update:-
我想在打印此以TD
$dir = str_replace("/var/www/13_Feb/subscriber-files/","","/var/www/13_Feb/subscriber-files/u*.[cC][sS][vV]");
$dir2 = str_replace("/var/www/13_Feb/subscriber-files/","","/var/www/13_Feb/subscriber-files/r*.[cC][sS][vV]");
每個目錄中的文件數是否相同?你是說你想在dir2中的第一個文件旁邊的dir中顯示第一個文件嗎? – 2012-02-15 14:19:47